5. 数据库初始化

Mysql 安装

前面使用Docker的方式安装过Mysql了,我为什么又要重新装一遍呢~~~请看第三篇:基础环境搭建里的说明!!

安装参考文档:http://www.highersoft.net/mobile/detailnotice_mobile.jsp?id=672

安装完成后使用Navicat或者Sqlyog连接到数据库,两个工具都可以。

 

数据库设计

使用Powerdesigner软件设计表数据及表结构,所有的数据库数据再复杂也不建立外键,因为在电商系统里,数据量大,做外键关联很耗性能。生成数据库脚本。sqlyog中,在左侧root上右键建立数据库,字符集选utf8mb4,能兼容utf8且能解决一些乱码的问题,分别建立了以下数据库:gulimall_oms、gulimall_pms、gulimall_sms、gulimall_ums、gulimall_wms。将每个库对应的脚本复制进去,执行,完成表的创建(相关脚本已经贴出,可以直接使用)。

 

 

 

 

数据库脚本如下:

  1 gulimall-oms.sql
  2 
  3 drop table if exists oms_order;
  4 
  5 drop table if exists oms_order_item;
  6 
  7 drop table if exists oms_order_operate_history;
  8 
  9 drop table if exists oms_order_return_apply;
 10 
 11 drop table if exists oms_order_return_reason;
 12 
 13 drop table if exists oms_order_setting;
 14 
 15 drop table if exists oms_payment_info;
 16 
 17 drop table if exists oms_refund_info;
 18 
 19 /*==============================================================*/
 20 /* Table: oms_order                                             */
 21 /*==============================================================*/
 22 create table oms_order
 23 (
 24    id                   bigint not null auto_increment comment 'id',
 25    member_id            bigint comment 'member_id',
 26    order_sn             char(32) comment '订单号',
 27    coupon_id            bigint comment '使用的优惠券',
 28    create_time          datetime comment 'create_time',
 29    member_username      varchar(200) comment '用户名',
 30    total_amount         decimal(18,4) comment '订单总额',
 31    pay_amount           decimal(18,4) comment '应付总额',
 32    freight_amount       decimal(18,4) comment '运费金额',
 33    promotion_amount     decimal(18,4) comment '促销优化金额(促销价、满减、阶梯价)',
 34    integration_amount   decimal(18,4) comment '积分抵扣金额',
 35    coupon_amount        decimal(18,4) comment '优惠券抵扣金额',
 36    discount_amount      decimal(18,4) comment '后台调整订单使用的折扣金额',
 37    pay_type             tinyint comment '支付方式【1->支付宝;2->微信;3->银联; 4->货到付款;】',
 38    source_type          tinyint comment '订单来源[0->PC订单;1->app订单]',
 39    status               tinyint comment '订单状态【0->待付款;1->待发货;2->已发货;3->已完成;4->已关闭;5->无效订单】',
 40    delivery_company     varchar(64) comment '物流公司(配送方式)',
 41    delivery_sn          varchar(64) comment '物流单号',
 42    auto_confirm_day     int comment '自动确认时间(天)',
 43    integration          int comment '可以获得的积分',
 44    growth               int comment '可以获得的成长值',
 45    bill_type            tinyint comment '发票类型[0->不开发票;1->电子发票;2->纸质发票]',
 46    bill_header          varchar(255) comment '发票抬头',
 47    bill_content         varchar(255) comment '发票内容',
 48    bill_receiver_phone  varchar(32) comment '收票人电话',
 49    bill_receiver_email  varchar(64) comment '收票人邮箱',
 50    receiver_name        varchar(100) comment '收货人姓名',
 51    receiver_phone       varchar(32) comment '收货人电话',
 52    receiver_post_code   varchar(32) comment '收货人邮编',
 53    receiver_province    varchar(32) comment '省份/直辖市',
 54    receiver_city        varchar(32) comment '城市',
 55    receiver_region      varchar(32) comment '',
 56    receiver_detail_address varchar(200) comment '详细地址',
 57    note                 varchar(500) comment '订单备注',
 58    confirm_status       tinyint comment '确认收货状态[0->未确认;1->已确认]',
 59    delete_status        tinyint comment '删除状态【0->未删除;1->已删除】',
 60    use_integration      int comment '下单时使用的积分',
 61    payment_time         datetime comment '支付时间',
 62    delivery_time        datetime comment '发货时间',
 63    receive_time         datetime comment '确认收货时间',
 64    comment_time         datetime comment '评价时间',
 65    modify_time          datetime comment '修改时间',
 66    primary key (id)
 67 );
 68 
 69 alter table oms_order comment '订单';
 70 
 71 /*==============================================================*/
 72 /* Table: oms_order_item                                        */
 73 /*==============================================================*/
 74 create table oms_order_item
 75 (
 76    id                   bigint not null auto_increment comment 'id',
 77    order_id             bigint comment 'order_id',
 78    order_sn             char(32) comment 'order_sn',
 79    spu_id               bigint comment 'spu_id',
 80    spu_name             varchar(255) comment 'spu_name',
 81    spu_pic              varchar(500) comment 'spu_pic',
 82    spu_brand            varchar(200) comment '品牌',
 83    category_id          bigint comment '商品分类id',
 84    sku_id               bigint comment '商品sku编号',
 85    sku_name             varchar(255) comment '商品sku名字',
 86    sku_pic              varchar(500) comment '商品sku图片',
 87    sku_price            decimal(18,4) comment '商品sku价格',
 88    sku_quantity         int comment '商品购买的数量',
 89    sku_attrs_vals       varchar(500) comment '商品销售属性组合(JSON)',
 90    promotion_amount     decimal(18,4) comment '商品促销分解金额',
 91    coupon_amount        decimal(18,4) comment '优惠券优惠分解金额',
 92    integration_amount   decimal(18,4) comment '积分优惠分解金额',
 93    real_amount          decimal(18,4) comment '该商品经过优惠后的分解金额',
 94    gift_integration     int comment '赠送积分',
 95    gift_growth          int comment '赠送成长值',
 96    primary key (id)
 97 );
 98 
 99 alter table oms_order_item comment '订单项信息';
100 
101 /*==============================================================*/
102 /* Table: oms_order_operate_history                             */
103 /*==============================================================*/
104 create table oms_order_operate_history
105 (
106    id                   bigint not null auto_increment comment 'id',
107    order_id             bigint comment '订单id',
108    operate_man          varchar(100) comment '操作人[用户;系统;后台管理员]',
109    create_time          datetime comment '操作时间',
110    order_status         tinyint comment '订单状态【0->待付款;1->待发货;2->已发货;3->已完成;4->已关闭;5->无效订单】',
111    note                 varchar(500) comment '备注',
112    primary key (id)
113 );
114 
115 alter table oms_order_operate_history comment '订单操作历史记录';
116 
117 /*==============================================================*/
118 /* Table: oms_order_return_apply                                */
119 /*==============================================================*/
120 create table oms_order_return_apply
121 (
122    id                   bigint not null auto_increment comment 'id',
123    order_id             bigint comment 'order_id',
124    sku_id               bigint comment '退货商品id',
125    order_sn             char(32) comment '订单编号',
126    create_time          datetime comment '申请时间',
127    member_username      varchar(64) comment '会员用户名',
128    return_amount        decimal(18,4) comment '退款金额',
129    return_name          varchar(100) comment '退货人姓名',
130    return_phone         varchar(20) comment '退货人电话',
131    status               tinyint(1) comment '申请状态[0->待处理;1->退货中;2->已完成;3->已拒绝]',
132    handle_time          datetime comment '处理时间',
133    sku_img              varchar(500) comment '商品图片',
134    sku_name             varchar(200) comment '商品名称',
135    sku_brand            varchar(200) comment '商品品牌',
136    sku_attrs_vals       varchar(500) comment '商品销售属性(JSON)',
137    sku_count            int comment '退货数量',
138    sku_price            decimal(18,4) comment '商品单价',
139    sku_real_price       decimal(18,4) comment '商品实际支付单价',
140    reason               varchar(200) comment '原因',
141    description述         varchar(500) comment '描述',
142    desc_pics            varchar(2000) comment '凭证图片,以逗号隔开',
143    handle_note          varchar(500) comment '处理备注',
144    handle_man           varchar(200) comment '处理人员',
145    receive_man          varchar(100) comment '收货人',
146    receive_time         datetime comment '收货时间',
147    receive_note         varchar(500) comment '收货备注',
148    receive_phone        varchar(20) comment '收货电话',
149    company_address      varchar(500) comment '公司收货地址',
150    primary key (id)
151 );
152 
153 alter table oms_order_return_apply comment '订单退货申请';
154 
155 /*==============================================================*/
156 /* Table: oms_order_return_reason                               */
157 /*==============================================================*/
158 create table oms_order_return_reason
159 (
160    id                   bigint not null auto_increment comment 'id',
161    name                 varchar(200) comment '退货原因名',
162    sort                 int comment '排序',
163    status               tinyint(1) comment '启用状态',
164    create_time          datetime comment 'create_time',
165    primary key (id)
166 );
167 
168 alter table oms_order_return_reason comment '退货原因';
169 
170 /*==============================================================*/
171 /* Table: oms_order_setting                                     */
172 /*==============================================================*/
173 create table oms_order_setting
174 (
175    id                   bigint not null auto_increment comment 'id',
176    flash_order_overtime int comment '秒杀订单超时关闭时间(分)',
177    normal_order_overtime int comment '正常订单超时时间(分)',
178    confirm_overtime     int comment '发货后自动确认收货时间(天)',
179    finish_overtime      int comment '自动完成交易时间,不能申请退货(天)',
180    comment_overtime     int comment '订单完成后自动好评时间(天)',
181    member_level         tinyint(2) comment '会员等级【0-不限会员等级,全部通用;其他-对应的其他会员等级】',
182    primary key (id)
183 );
184 
185 alter table oms_order_setting comment '订单配置信息';
186 
187 /*==============================================================*/
188 /* Table: oms_payment_info                                      */
189 /*==============================================================*/
190 create table oms_payment_info
191 (
192    id                   bigint not null auto_increment comment 'id',
193    order_sn             char(32) comment '订单号(对外业务号)',
194    order_id             bigint comment '订单id',
195    alipay_trade_no      varchar(50) comment '支付宝交易流水号',
196    total_amount         decimal(18,4) comment '支付总金额',
197    subject              varchar(200) comment '交易内容',
198    payment_status       varchar(20) comment '支付状态',
199    create_time          datetime comment '创建时间',
200    confirm_time         datetime comment '确认时间',
201    callback_content     varchar(4000) comment '回调内容',
202    callback_time        datetime comment '回调时间',
203    primary key (id)
204 );
205 
206 alter table oms_payment_info comment '支付信息表';
207 
208 /*==============================================================*/
209 /* Table: oms_refund_info                                       */
210 /*==============================================================*/
211 create table oms_refund_info
212 (
213    id                   bigint not null auto_increment comment 'id',
214    order_return_id      bigint comment '退款的订单',
215    refund               decimal(18,4) comment '退款金额',
216    refund_sn            varchar(64) comment '退款交易流水号',
217    refund_status        tinyint(1) comment '退款状态',
218    refund_channel       tinyint comment '退款渠道[1-支付宝,2-微信,3-银联,4-汇款]',
219    refund_content       varchar(5000),
220    primary key (id)
221 );
222 
223 alter table oms_refund_info comment '退款信息';
  1 gulimall-pms.sql
  2 
  3 drop table if exists pms_attr;
  4 
  5 drop table if exists pms_attr_attrgroup_relation;
  6 
  7 drop table if exists pms_attr_group;
  8 
  9 drop table if exists pms_brand;
 10 
 11 drop table if exists pms_category;
 12 
 13 drop table if exists pms_category_brand_relation;
 14 
 15 drop table if exists pms_comment_replay;
 16 
 17 drop table if exists pms_product_attr_value;
 18 
 19 drop table if exists pms_sku_images;
 20 
 21 drop table if exists pms_sku_info;
 22 
 23 drop table if exists pms_sku_sale_attr_value;
 24 
 25 drop table if exists pms_spu_comment;
 26 
 27 drop table if exists pms_spu_images;
 28 
 29 drop table if exists pms_spu_info;
 30 
 31 drop table if exists pms_spu_info_desc;
 32 
 33 /*==============================================================*/
 34 /* Table: pms_attr                                              */
 35 /*==============================================================*/
 36 create table pms_attr
 37 (
 38    attr_id              bigint not null auto_increment comment '属性id',
 39    attr_name            char(30) comment '属性名',
 40    search_type          tinyint comment '是否需要检索[0-不需要,1-需要]',
 41    icon                 varchar(255) comment '属性图标',
 42    value_select         char(255) comment '可选值列表[用逗号分隔]',
 43    attr_type            tinyint comment '属性类型[0-销售属性,1-基本属性,2-既是销售属性又是基本属性]',
 44    enable               bigint comment '启用状态[0 - 禁用,1 - 启用]',
 45    catelog_id           bigint comment '所属分类',
 46    show_desc            tinyint comment '快速展示【是否展示在介绍上;0-否 1-是】,在sku中仍然可以调整',
 47    primary key (attr_id)
 48 );
 49 
 50 alter table pms_attr comment '商品属性';
 51 
 52 /*==============================================================*/
 53 /* Table: pms_attr_attrgroup_relation                           */
 54 /*==============================================================*/
 55 create table pms_attr_attrgroup_relation
 56 (
 57    id                   bigint not null auto_increment comment 'id',
 58    attr_id              bigint comment '属性id',
 59    attr_group_id        bigint comment '属性分组id',
 60    attr_sort            int comment '属性组内排序',
 61    primary key (id)
 62 );
 63 
 64 alter table pms_attr_attrgroup_relation comment '属性&属性分组关联';
 65 
 66 /*==============================================================*/
 67 /* Table: pms_attr_group                                        */
 68 /*==============================================================*/
 69 create table pms_attr_group
 70 (
 71    attr_group_id        bigint not null auto_increment comment '分组id',
 72    attr_group_name      char(20) comment '组名',
 73    sort                 int comment '排序',
 74    descript             varchar(255) comment '描述',
 75    icon                 varchar(255) comment '组图标',
 76    catelog_id           bigint comment '所属分类id',
 77    primary key (attr_group_id)
 78 );
 79 
 80 alter table pms_attr_group comment '属性分组';
 81 
 82 /*==============================================================*/
 83 /* Table: pms_brand                                             */
 84 /*==============================================================*/
 85 create table pms_brand
 86 (
 87    brand_id             bigint not null auto_increment comment '品牌id',
 88    name                 char(50) comment '品牌名',
 89    logo                 varchar(2000) comment '品牌logo地址',
 90    descript             longtext comment '介绍',
 91    show_status          tinyint comment '显示状态[0-不显示;1-显示]',
 92    first_letter         char(1) comment '检索首字母',
 93    sort                 int comment '排序',
 94    primary key (brand_id)
 95 );
 96 
 97 alter table pms_brand comment '品牌';
 98 
 99 /*==============================================================*/
100 /* Table: pms_category                                          */
101 /*==============================================================*/
102 create table pms_category
103 (
104    cat_id               bigint not null auto_increment comment '分类id',
105    name                 char(50) comment '分类名称',
106    parent_cid           bigint comment '父分类id',
107    cat_level            int comment '层级',
108    show_status          tinyint comment '是否显示[0-不显示,1显示]',
109    sort                 int comment '排序',
110    icon                 char(255) comment '图标地址',
111    product_unit         char(50) comment '计量单位',
112    product_count        int comment '商品数量',
113    primary key (cat_id)
114 );
115 
116 alter table pms_category comment '商品三级分类';
117 
118 /*==============================================================*/
119 /* Table: pms_category_brand_relation                           */
120 /*==============================================================*/
121 create table pms_category_brand_relation
122 (
123    id                   bigint not null auto_increment,
124    brand_id             bigint comment '品牌id',
125    catelog_id           bigint comment '分类id',
126    brand_name           varchar(255),
127    catelog_name         varchar(255),
128    primary key (id)
129 );
130 
131 alter table pms_category_brand_relation comment '品牌分类关联';
132 
133 /*==============================================================*/
134 /* Table: pms_comment_replay                                    */
135 /*==============================================================*/
136 create table pms_comment_replay
137 (
138    id                   bigint not null auto_increment comment 'id',
139    comment_id           bigint comment '评论id',
140    reply_id             bigint comment '回复id',
141    primary key (id)
142 );
143 
144 alter table pms_comment_replay comment '商品评价回复关系';
145 
146 /*==============================================================*/
147 /* Table: pms_product_attr_value                                */
148 /*==============================================================*/
149 create table pms_product_attr_value
150 (
151    id                   bigint not null auto_increment comment 'id',
152    spu_id               bigint comment '商品id',
153    attr_id              bigint comment '属性id',
154    attr_name            varchar(200) comment '属性名',
155    attr_value           varchar(200) comment '属性值',
156    attr_sort            int comment '顺序',
157    quick_show           tinyint comment '快速展示【是否展示在介绍上;0-否 1-是】',
158    primary key (id)
159 );
160 
161 alter table pms_product_attr_value comment 'spu属性值';
162 
163 /*==============================================================*/
164 /* Table: pms_sku_images                                        */
165 /*==============================================================*/
166 create table pms_sku_images
167 (
168    id                   bigint not null auto_increment comment 'id',
169    sku_id               bigint comment 'sku_id',
170    img_url              varchar(255) comment '图片地址',
171    img_sort             int comment '排序',
172    default_img          int comment '默认图[0 - 不是默认图,1 - 是默认图]',
173    primary key (id)
174 );
175 
176 alter table pms_sku_images comment 'sku图片';
177 
178 /*==============================================================*/
179 /* Table: pms_sku_info                                          */
180 /*==============================================================*/
181 create table pms_sku_info
182 (
183    sku_id               bigint not null auto_increment comment 'skuId',
184    spu_id               bigint comment 'spuId',
185    sku_name             varchar(255) comment 'sku名称',
186    sku_desc             varchar(2000) comment 'sku介绍描述',
187    catalog_id           bigint comment '所属分类id',
188    brand_id             bigint comment '品牌id',
189    sku_default_img      varchar(255) comment '默认图片',
190    sku_title            varchar(255) comment '标题',
191    sku_subtitle         varchar(2000) comment '副标题',
192    price                decimal(18,4) comment '价格',
193    sale_count           bigint comment '销量',
194    primary key (sku_id)
195 );
196 
197 alter table pms_sku_info comment 'sku信息';
198 
199 /*==============================================================*/
200 /* Table: pms_sku_sale_attr_value                               */
201 /*==============================================================*/
202 create table pms_sku_sale_attr_value
203 (
204    id                   bigint not null auto_increment comment 'id',
205    sku_id               bigint comment 'sku_id',
206    attr_id              bigint comment 'attr_id',
207    attr_name            varchar(200) comment '销售属性名',
208    attr_value           varchar(200) comment '销售属性值',
209    attr_sort            int comment '顺序',
210    primary key (id)
211 );
212 
213 alter table pms_sku_sale_attr_value comment 'sku销售属性&值';
214 
215 /*==============================================================*/
216 /* Table: pms_spu_comment                                       */
217 /*==============================================================*/
218 create table pms_spu_comment
219 (
220    id                   bigint not null auto_increment comment 'id',
221    sku_id               bigint comment 'sku_id',
222    spu_id               bigint comment 'spu_id',
223    spu_name             varchar(255) comment '商品名字',
224    member_nick_name     varchar(255) comment '会员昵称',
225    star                 tinyint(1) comment '星级',
226    member_ip            varchar(64) comment '会员ip',
227    create_time          datetime comment '创建时间',
228    show_status          tinyint(1) comment '显示状态[0-不显示,1-显示]',
229    spu_attributes       varchar(255) comment '购买时属性组合',
230    likes_count          int comment '点赞数',
231    reply_count          int comment '回复数',
232    resources            varchar(1000) comment '评论图片/视频[json数据;[{type:文件类型,url:资源路径}]]',
233    content              text comment '内容',
234    member_icon          varchar(255) comment '用户头像',
235    comment_type         tinyint comment '评论类型[0 - 对商品的直接评论,1 - 对评论的回复]',
236    primary key (id)
237 );
238 
239 alter table pms_spu_comment comment '商品评价';
240 
241 /*==============================================================*/
242 /* Table: pms_spu_images                                        */
243 /*==============================================================*/
244 create table pms_spu_images
245 (
246    id                   bigint not null auto_increment comment 'id',
247    spu_id               bigint comment 'spu_id',
248    img_name             varchar(200) comment '图片名',
249    img_url              varchar(255) comment '图片地址',
250    img_sort             int comment '顺序',
251    default_img          tinyint comment '是否默认图',
252    primary key (id)
253 );
254 
255 alter table pms_spu_images comment 'spu图片';
256 
257 /*==============================================================*/
258 /* Table: pms_spu_info                                          */
259 /*==============================================================*/
260 create table pms_spu_info
261 (
262    id                   bigint not null auto_increment comment '商品id',
263    spu_name             varchar(200) comment '商品名称',
264    spu_description      varchar(1000) comment '商品描述',
265    catalog_id           bigint comment '所属分类id',
266    brand_id             bigint comment '品牌id',
267    weight               decimal(18,4),
268    publish_status       tinyint comment '上架状态[0 - 下架,1 - 上架]',
269    create_time          datetime,
270    update_time          datetime,
271    primary key (id)
272 );
273 
274 alter table pms_spu_info comment 'spu信息';
275 
276 /*==============================================================*/
277 /* Table: pms_spu_info_desc                                     */
278 /*==============================================================*/
279 create table pms_spu_info_desc
280 (
281    spu_id               bigint not null comment '商品id',
282    decript              longtext comment '商品介绍',
283    primary key (spu_id)
284 );
285 
286 alter table pms_spu_info_desc comment 'spu信息介绍';
  1 gulimall_sms.sql
  2 
  3 drop table if exists sms_coupon;
  4 
  5 drop table if exists sms_coupon_history;
  6 
  7 drop table if exists sms_coupon_spu_category_relation;
  8 
  9 drop table if exists sms_coupon_spu_relation;
 10 
 11 drop table if exists sms_home_adv;
 12 
 13 drop table if exists sms_home_subject;
 14 
 15 drop table if exists sms_home_subject_spu;
 16 
 17 drop table if exists sms_member_price;
 18 
 19 drop table if exists sms_seckill_promotion;
 20 
 21 drop table if exists sms_seckill_session;
 22 
 23 drop table if exists sms_seckill_sku_notice;
 24 
 25 drop table if exists sms_seckill_sku_relation;
 26 
 27 drop table if exists sms_sku_full_reduction;
 28 
 29 drop table if exists sms_sku_ladder;
 30 
 31 drop table if exists sms_spu_bounds;
 32 
 33 /*==============================================================*/
 34 /* Table: sms_coupon                                            */
 35 /*==============================================================*/
 36 create table sms_coupon
 37 (
 38    id                   bigint not null auto_increment comment 'id',
 39    coupon_type          tinyint(1) comment '优惠卷类型[0->全场赠券;1->会员赠券;2->购物赠券;3->注册赠券]',
 40    coupon_img           varchar(2000) comment '优惠券图片',
 41    coupon_name          varchar(100) comment '优惠卷名字',
 42    num                  int comment '数量',
 43    amount               decimal(18,4) comment '金额',
 44    per_limit            int comment '每人限领张数',
 45    min_point            decimal(18,4) comment '使用门槛',
 46    start_time           datetime comment '开始时间',
 47    end_time             datetime comment '结束时间',
 48    use_type             tinyint(1) comment '使用类型[0->全场通用;1->指定分类;2->指定商品]',
 49    note                 varchar(200) comment '备注',
 50    publish_count        int(11) comment '发行数量',
 51    use_count            int(11) comment '已使用数量',
 52    receive_count        int(11) comment '领取数量',
 53    enable_start_time    datetime comment '可以领取的开始日期',
 54    enable_end_time      datetime comment '可以领取的结束日期',
 55    code                 varchar(64) comment '优惠码',
 56    member_level         tinyint(1) comment '可以领取的会员等级[0->不限等级,其他-对应等级]',
 57    publish              tinyint(1) comment '发布状态[0-未发布,1-已发布]',
 58    primary key (id)
 59 );
 60 
 61 alter table sms_coupon comment '优惠券信息';
 62 
 63 /*==============================================================*/
 64 /* Table: sms_coupon_history                                    */
 65 /*==============================================================*/
 66 create table sms_coupon_history
 67 (
 68    id                   bigint not null auto_increment comment 'id',
 69    coupon_id            bigint comment '优惠券id',
 70    member_id            bigint comment '会员id',
 71    member_nick_name     varchar(64) comment '会员名字',
 72    get_type             tinyint(1) comment '获取方式[0->后台赠送;1->主动领取]',
 73    create_time          datetime comment '创建时间',
 74    use_type             tinyint(1) comment '使用状态[0->未使用;1->已使用;2->已过期]',
 75    use_time             datetime comment '使用时间',
 76    order_id             bigint comment '订单id',
 77    order_sn             bigint comment '订单号',
 78    primary key (id)
 79 );
 80 
 81 alter table sms_coupon_history comment '优惠券领取历史记录';
 82 
 83 /*==============================================================*/
 84 /* Table: sms_coupon_spu_category_relation                      */
 85 /*==============================================================*/
 86 create table sms_coupon_spu_category_relation
 87 (
 88    id                   bigint not null auto_increment comment 'id',
 89    coupon_id            bigint comment '优惠券id',
 90    category_id          bigint comment '产品分类id',
 91    category_name        varchar(64) comment '产品分类名称',
 92    primary key (id)
 93 );
 94 
 95 alter table sms_coupon_spu_category_relation comment '优惠券分类关联';
 96 
 97 /*==============================================================*/
 98 /* Table: sms_coupon_spu_relation                               */
 99 /*==============================================================*/
100 create table sms_coupon_spu_relation
101 (
102    id                   bigint not null auto_increment comment 'id',
103    coupon_id            bigint comment '优惠券id',
104    spu_id               bigint comment 'spu_id',
105    spu_name             varchar(255) comment 'spu_name',
106    primary key (id)
107 );
108 
109 alter table sms_coupon_spu_relation comment '优惠券与产品关联';
110 
111 /*==============================================================*/
112 /* Table: sms_home_adv                                          */
113 /*==============================================================*/
114 create table sms_home_adv
115 (
116    id                   bigint not null auto_increment comment 'id',
117    name                 varchar(100) comment '名字',
118    pic                  varchar(500) comment '图片地址',
119    start_time           datetime comment '开始时间',
120    end_time             datetime comment '结束时间',
121    status               tinyint(1) comment '状态',
122    click_count          int comment '点击数',
123    url                  varchar(500) comment '广告详情连接地址',
124    note                 varchar(500) comment '备注',
125    sort                 int comment '排序',
126    publisher_id         bigint comment '发布者',
127    auth_id              bigint comment '审核者',
128    primary key (id)
129 );
130 
131 alter table sms_home_adv comment '首页轮播广告';
132 
133 /*==============================================================*/
134 /* Table: sms_home_subject                                      */
135 /*==============================================================*/
136 create table sms_home_subject
137 (
138    id                   bigint not null auto_increment comment 'id',
139    name                 varchar(200) comment '专题名字',
140    title                varchar(255) comment '专题标题',
141    sub_title            varchar(255) comment '专题副标题',
142    status               tinyint(1) comment '显示状态',
143    url                  varchar(500) comment '详情连接',
144    sort                 int comment '排序',
145    img                  varchar(500) comment '专题图片地址',
146    primary key (id)
147 );
148 
149 alter table sms_home_subject comment '首页专题表【jd首页下面很多专题,每个专题链接新的页面,展示专题商品信息】';
150 
151 /*==============================================================*/
152 /* Table: sms_home_subject_spu                                  */
153 /*==============================================================*/
154 create table sms_home_subject_spu
155 (
156    id                   bigint not null auto_increment comment 'id',
157    name                 varchar(200) comment '专题名字',
158    subject_id           bigint comment '专题id',
159    spu_id               bigint comment 'spu_id',
160    sort                 int comment '排序',
161    primary key (id)
162 );
163 
164 alter table sms_home_subject_spu comment '专题商品';
165 
166 /*==============================================================*/
167 /* Table: sms_member_price                                      */
168 /*==============================================================*/
169 create table sms_member_price
170 (
171    id                   bigint not null auto_increment comment 'id',
172    sku_id               bigint comment 'sku_id',
173    member_level_id      bigint comment '会员等级id',
174    member_level_name    varchar(100) comment '会员等级名',
175    member_price         decimal(18,4) comment '会员对应价格',
176    add_other            tinyint(1) comment '可否叠加其他优惠[0-不可叠加优惠,1-可叠加]',
177    primary key (id)
178 );
179 
180 alter table sms_member_price comment '商品会员价格';
181 
182 /*==============================================================*/
183 /* Table: sms_seckill_promotion                                 */
184 /*==============================================================*/
185 create table sms_seckill_promotion
186 (
187    id                   bigint not null auto_increment comment 'id',
188    title                varchar(255) comment '活动标题',
189    start_time           datetime comment '开始日期',
190    end_time             datetime comment '结束日期',
191    status               tinyint comment '上下线状态',
192    create_time          datetime comment '创建时间',
193    user_id              bigint comment '创建人',
194    primary key (id)
195 );
196 
197 alter table sms_seckill_promotion comment '秒杀活动';
198 
199 /*==============================================================*/
200 /* Table: sms_seckill_session                                   */
201 /*==============================================================*/
202 create table sms_seckill_session
203 (
204    id                   bigint not null auto_increment comment 'id',
205    name                 varchar(200) comment '场次名称',
206    start_time           datetime comment '每日开始时间',
207    end_time             datetime comment '每日结束时间',
208    status               tinyint(1) comment '启用状态',
209    create_time          datetime comment '创建时间',
210    primary key (id)
211 );
212 
213 alter table sms_seckill_session comment '秒杀活动场次';
214 
215 /*==============================================================*/
216 /* Table: sms_seckill_sku_notice                                */
217 /*==============================================================*/
218 create table sms_seckill_sku_notice
219 (
220    id                   bigint not null auto_increment comment 'id',
221    member_id            bigint comment 'member_id',
222    sku_id               bigint comment 'sku_id',
223    session_id           bigint comment '活动场次id',
224    subcribe_time        datetime comment '订阅时间',
225    send_time            datetime comment '发送时间',
226    notice_type          tinyint(1) comment '通知方式[0-短信,1-邮件]',
227    primary key (id)
228 );
229 
230 alter table sms_seckill_sku_notice comment '秒杀商品通知订阅';
231 
232 /*==============================================================*/
233 /* Table: sms_seckill_sku_relation                              */
234 /*==============================================================*/
235 create table sms_seckill_sku_relation
236 (
237    id                   bigint not null auto_increment comment 'id',
238    promotion_id         bigint comment '活动id',
239    promotion_session_id bigint comment '活动场次id',
240    sku_id               bigint comment '商品id',
241    seckill_price        decimal comment '秒杀价格',
242    seckill_count        decimal comment '秒杀总量',
243    seckill_limit        decimal comment '每人限购数量',
244    seckill_sort         int comment '排序',
245    primary key (id)
246 );
247 
248 alter table sms_seckill_sku_relation comment '秒杀活动商品关联';
249 
250 /*==============================================================*/
251 /* Table: sms_sku_full_reduction                                */
252 /*==============================================================*/
253 create table sms_sku_full_reduction
254 (
255    id                   bigint not null auto_increment comment 'id',
256    sku_id               bigint comment 'spu_id',
257    full_price           decimal(18,4) comment '满多少',
258    reduce_price         decimal(18,4) comment '减多少',
259    add_other            tinyint(1) comment '是否参与其他优惠',
260    primary key (id)
261 );
262 
263 alter table sms_sku_full_reduction comment '商品满减信息';
264 
265 /*==============================================================*/
266 /* Table: sms_sku_ladder                                        */
267 /*==============================================================*/
268 create table sms_sku_ladder
269 (
270    id                   bigint not null auto_increment comment 'id',
271    sku_id               bigint comment 'spu_id',
272    full_count           int comment '满几件',
273    discount             decimal(4,2) comment '打几折',
274    price                decimal(18,4) comment '折后价',
275    add_other            tinyint(1) comment '是否叠加其他优惠[0-不可叠加,1-可叠加]',
276    primary key (id)
277 );
278 
279 alter table sms_sku_ladder comment '商品阶梯价格';
280 
281 /*==============================================================*/
282 /* Table: sms_spu_bounds                                        */
283 /*==============================================================*/
284 create table sms_spu_bounds
285 (
286    id                   bigint not null auto_increment comment 'id',
287    spu_id               bigint,
288    grow_bounds          decimal(18,4) comment '成长积分',
289    buy_bounds           decimal(18,4) comment '购物积分',
290    work                 tinyint(1) comment '优惠生效情况[1111(四个状态位,从右到左);0 - 无优惠,成长积分是否赠送;1 - 无优惠,购物积分是否赠送;2 - 有优惠,成长积分是否赠送;3 - 有优惠,购物积分是否赠送【状态位0:不赠送,1:赠送】]',
291    primary key (id)
292 );
293 
294 alter table sms_spu_bounds comment '商品spu积分设置';
  1 gulimall_ums.sql
  2 
  3 drop table if exists ums_growth_change_history;
  4 
  5 drop table if exists ums_integration_change_history;
  6 
  7 drop table if exists ums_member;
  8 
  9 drop table if exists ums_member_collect_spu;
 10 
 11 drop table if exists ums_member_collect_subject;
 12 
 13 drop table if exists ums_member_level;
 14 
 15 drop table if exists ums_member_login_log;
 16 
 17 drop table if exists ums_member_receive_address;
 18 
 19 drop table if exists ums_member_statistics_info;
 20 
 21 /*==============================================================*/
 22 /* Table: ums_growth_change_history                             */
 23 /*==============================================================*/
 24 create table ums_growth_change_history
 25 (
 26    id                   bigint not null auto_increment comment 'id',
 27    member_id            bigint comment 'member_id',
 28    create_time          datetime comment 'create_time',
 29    change_count         int comment '改变的值(正负计数)',
 30    note                 varchar(0) comment '备注',
 31    source_type          tinyint comment '积分来源[0-购物,1-管理员修改]',
 32    primary key (id)
 33 );
 34 
 35 alter table ums_growth_change_history comment '成长值变化历史记录';
 36 
 37 /*==============================================================*/
 38 /* Table: ums_integration_change_history                        */
 39 /*==============================================================*/
 40 create table ums_integration_change_history
 41 (
 42    id                   bigint not null auto_increment comment 'id',
 43    member_id            bigint comment 'member_id',
 44    create_time          datetime comment 'create_time',
 45    change_count         int comment '变化的值',
 46    note                 varchar(255) comment '备注',
 47    source_tyoe          tinyint comment '来源[0->购物;1->管理员修改;2->活动]',
 48    primary key (id)
 49 );
 50 
 51 alter table ums_integration_change_history comment '积分变化历史记录';
 52 
 53 /*==============================================================*/
 54 /* Table: ums_member                                            */
 55 /*==============================================================*/
 56 create table ums_member
 57 (
 58    id                   bigint not null auto_increment comment 'id',
 59    level_id             bigint comment '会员等级id',
 60    username             char(64) comment '用户名',
 61    password             varchar(64) comment '密码',
 62    nickname             varchar(64) comment '昵称',
 63    mobile               varchar(20) comment '手机号码',
 64    email                varchar(64) comment '邮箱',
 65    header               varchar(500) comment '头像',
 66    gender               tinyint comment '性别',
 67    birth                date comment '生日',
 68    city                 varchar(500) comment '所在城市',
 69    job                  varchar(255) comment '职业',
 70    sign                 varchar(255) comment '个性签名',
 71    source_type          tinyint comment '用户来源',
 72    integration          int comment '积分',
 73    growth               int comment '成长值',
 74    status               tinyint comment '启用状态',
 75    create_time          datetime comment '注册时间',
 76    primary key (id)
 77 );
 78 
 79 alter table ums_member comment '会员';
 80 
 81 /*==============================================================*/
 82 /* Table: ums_member_collect_spu                                */
 83 /*==============================================================*/
 84 create table ums_member_collect_spu
 85 (
 86    id                   bigint not null comment 'id',
 87    member_id            bigint comment '会员id',
 88    spu_id               bigint comment 'spu_id',
 89    spu_name             varchar(500) comment 'spu_name',
 90    spu_img              varchar(500) comment 'spu_img',
 91    create_time          datetime comment 'create_time',
 92    primary key (id)
 93 );
 94 
 95 alter table ums_member_collect_spu comment '会员收藏的商品';
 96 
 97 /*==============================================================*/
 98 /* Table: ums_member_collect_subject                            */
 99 /*==============================================================*/
100 create table ums_member_collect_subject
101 (
102    id                   bigint not null auto_increment comment 'id',
103    subject_id           bigint comment 'subject_id',
104    subject_name         varchar(255) comment 'subject_name',
105    subject_img          varchar(500) comment 'subject_img',
106    subject_urll         varchar(500) comment '活动url',
107    primary key (id)
108 );
109 
110 alter table ums_member_collect_subject comment '会员收藏的专题活动';
111 
112 /*==============================================================*/
113 /* Table: ums_member_level                                      */
114 /*==============================================================*/
115 create table ums_member_level
116 (
117    id                   bigint not null auto_increment comment 'id',
118    name                 varchar(100) comment '等级名称',
119    growth_point         int comment '等级需要的成长值',
120    default_status       tinyint comment '是否为默认等级[0->不是;1->是]',
121    free_freight_point   decimal(18,4) comment '免运费标准',
122    comment_growth_point int comment '每次评价获取的成长值',
123    priviledge_free_freight tinyint comment '是否有免邮特权',
124    priviledge_member_price tinyint comment '是否有会员价格特权',
125    priviledge_birthday  tinyint comment '是否有生日特权',
126    note                 varchar(255) comment '备注',
127    primary key (id)
128 );
129 
130 alter table ums_member_level comment '会员等级';
131 
132 /*==============================================================*/
133 /* Table: ums_member_login_log                                  */
134 /*==============================================================*/
135 create table ums_member_login_log
136 (
137    id                   bigint not null auto_increment comment 'id',
138    member_id            bigint comment 'member_id',
139    create_time          datetime comment '创建时间',
140    ip                   varchar(64) comment 'ip',
141    city                 varchar(64) comment 'city',
142    login_type           tinyint(1) comment '登录类型[1-web,2-app]',
143    primary key (id)
144 );
145 
146 alter table ums_member_login_log comment '会员登录记录';
147 
148 /*==============================================================*/
149 /* Table: ums_member_receive_address                            */
150 /*==============================================================*/
151 create table ums_member_receive_address
152 (
153    id                   bigint not null auto_increment comment 'id',
154    member_id            bigint comment 'member_id',
155    name                 varchar(255) comment '收货人姓名',
156    phone                varchar(64) comment '电话',
157    post_code            varchar(64) comment '邮政编码',
158    province             varchar(100) comment '省份/直辖市',
159    city                 varchar(100) comment '城市',
160    region               varchar(100) comment '',
161    detail_address       varchar(255) comment '详细地址(街道)',
162    areacode             varchar(15) comment '省市区代码',
163    default_status       tinyint(1) comment '是否默认',
164    primary key (id)
165 );
166 
167 alter table ums_member_receive_address comment '会员收货地址';
168 
169 /*==============================================================*/
170 /* Table: ums_member_statistics_info                            */
171 /*==============================================================*/
172 create table ums_member_statistics_info
173 (
174    id                   bigint not null auto_increment comment 'id',
175    member_id            bigint comment '会员id',
176    consume_amount       decimal(18,4) comment '累计消费金额',
177    coupon_amount        decimal(18,4) comment '累计优惠金额',
178    order_count          int comment '订单数量',
179    coupon_count         int comment '优惠券数量',
180    comment_count        int comment '评价数',
181    return_order_count   int comment '退货数量',
182    login_count          int comment '登录次数',
183    attend_count         int comment '关注数量',
184    fans_count           int comment '粉丝数量',
185    collect_product_count int comment '收藏的商品数量',
186    collect_subject_count int comment '收藏的专题活动数量',
187    collect_comment_count int comment '收藏的评论数量',
188    invite_friend_count  int comment '邀请的朋友数量',
189    primary key (id)
190 );
191 
192 alter table ums_member_statistics_info comment '会员统计信息';
  1 gulimall_wms.sql
  2 
  3 /*
  4 SQLyog Ultimate v11.25 (64 bit)
  5 MySQL - 5.7.27 : Database - gulimall_wms
  6 *********************************************************************
  7 */
  8 
  9 
 10 /*!40101 SET NAMES utf8 */;
 11 
 12 /*!40101 SET SQL_MODE=''*/;
 13 
 14 /*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
 15 /*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
 16 /*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
 17 /*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
 18 CREATE DATABASE /*!32312 IF NOT EXISTS*/`gulimall_wms` /*!40100 DEFAULT CHARACTER SET utf8mb4 */;
 19 
 20 USE `gulimall_wms`;
 21 
 22 /*Table structure for table `undo_log` */
 23 
 24 DROP TABLE IF EXISTS `undo_log`;
 25 
 26 CREATE TABLE `undo_log` (
 27   `id` bigint(20) NOT NULL AUTO_INCREMENT,
 28   `branch_id` bigint(20) NOT NULL,
 29   `xid` varchar(100) NOT NULL,
 30   `context` varchar(128) NOT NULL,
 31   `rollback_info` longblob NOT NULL,
 32   `log_status` int(11) NOT NULL,
 33   `log_created` datetime NOT NULL,
 34   `log_modified` datetime NOT NULL,
 35   `ext` varchar(100) DEFAULT NULL,
 36   PRIMARY KEY (`id`),
 37   UNIQUE KEY `ux_undo_log` (`xid`,`branch_id`) USING BTREE
 38 ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
 39 
 40 /*Data for the table `undo_log` */
 41 
 42 /*Table structure for table `wms_purchase` */
 43 
 44 DROP TABLE IF EXISTS `wms_purchase`;
 45 
 46 CREATE TABLE `wms_purchase` (
 47   `id` bigint(20) NOT NULL AUTO_INCREMENT,
 48   `assignee_id` bigint(20) DEFAULT NULL,
 49   `assignee_name` varchar(255) DEFAULT NULL,
 50   `phone` char(13) DEFAULT NULL,
 51   `priority` int(4) DEFAULT NULL,
 52   `status` int(4) DEFAULT NULL,
 53   `ware_id` bigint(20) DEFAULT NULL,
 54   `amount` decimal(18,4) DEFAULT NULL,
 55   `create_time` datetime DEFAULT NULL,
 56   `update_time` datetime DEFAULT NULL,
 57   PRIMARY KEY (`id`)
 58 ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='采购信息';
 59 
 60 /*Data for the table `wms_purchase` */
 61 
 62 /*Table structure for table `wms_purchase_detail` */
 63 
 64 DROP TABLE IF EXISTS `wms_purchase_detail`;
 65 
 66 CREATE TABLE `wms_purchase_detail` (
 67   `id` bigint(20) NOT NULL AUTO_INCREMENT,
 68   `purchase_id` bigint(20) DEFAULT NULL COMMENT '采购单id',
 69   `sku_id` bigint(20) DEFAULT NULL COMMENT '采购商品id',
 70   `sku_num` int(11) DEFAULT NULL COMMENT '采购数量',
 71   `sku_price` decimal(18,4) DEFAULT NULL COMMENT '采购金额',
 72   `ware_id` bigint(20) DEFAULT NULL COMMENT '仓库id',
 73   `status` int(11) DEFAULT NULL COMMENT '状态[0新建,1已分配,2正在采购,3已完成,4采购失败]',
 74   PRIMARY KEY (`id`)
 75 ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
 76 
 77 /*Data for the table `wms_purchase_detail` */
 78 
 79 /*Table structure for table `wms_ware_info` */
 80 
 81 DROP TABLE IF EXISTS `wms_ware_info`;
 82 
 83 CREATE TABLE `wms_ware_info` (
 84   `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT 'id',
 85   `name` varchar(255) DEFAULT NULL COMMENT '仓库名',
 86   `address` varchar(255) DEFAULT NULL COMMENT '仓库地址',
 87   `areacode` varchar(20) DEFAULT NULL COMMENT '区域编码',
 88   PRIMARY KEY (`id`)
 89 ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='仓库信息';
 90 
 91 /*Data for the table `wms_ware_info` */
 92 
 93 /*Table structure for table `wms_ware_order_task` */
 94 
 95 DROP TABLE IF EXISTS `wms_ware_order_task`;
 96 
 97 CREATE TABLE `wms_ware_order_task` (
 98   `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT 'id',
 99   `order_id` bigint(20) DEFAULT NULL COMMENT 'order_id',
100   `order_sn` varchar(255) DEFAULT NULL COMMENT 'order_sn',
101   `consignee` varchar(100) DEFAULT NULL COMMENT '收货人',
102   `consignee_tel` char(15) DEFAULT NULL COMMENT '收货人电话',
103   `delivery_address` varchar(500) DEFAULT NULL COMMENT '配送地址',
104   `order_comment` varchar(200) DEFAULT NULL COMMENT '订单备注',
105   `payment_way` tinyint(1) DEFAULT NULL COMMENT '付款方式【 1:在线付款 2:货到付款】',
106   `task_status` tinyint(2) DEFAULT NULL COMMENT '任务状态',
107   `order_body` varchar(255) DEFAULT NULL COMMENT '订单描述',
108   `tracking_no` char(30) DEFAULT NULL COMMENT '物流单号',
109   `create_time` datetime DEFAULT NULL COMMENT 'create_time',
110   `ware_id` bigint(20) DEFAULT NULL COMMENT '仓库id',
111   `task_comment` varchar(500) DEFAULT NULL COMMENT '工作单备注',
112   PRIMARY KEY (`id`)
113 ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='库存工作单';
114 
115 /*Data for the table `wms_ware_order_task` */
116 
117 /*Table structure for table `wms_ware_order_task_detail` */
118 
119 DROP TABLE IF EXISTS `wms_ware_order_task_detail`;
120 
121 CREATE TABLE `wms_ware_order_task_detail` (
122   `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT 'id',
123   `sku_id` bigint(20) DEFAULT NULL COMMENT 'sku_id',
124   `sku_name` varchar(255) DEFAULT NULL COMMENT 'sku_name',
125   `sku_num` int(11) DEFAULT NULL COMMENT '购买个数',
126   `task_id` bigint(20) DEFAULT NULL COMMENT '工作单id',
127   `ware_id` bigint(20) DEFAULT NULL COMMENT '仓库id',
128   `lock_status` int(1) DEFAULT NULL COMMENT '1-已锁定  2-已解锁  3-扣减',
129   PRIMARY KEY (`id`)
130 ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='库存工作单';
131 
132 /*Data for the table `wms_ware_order_task_detail` */
133 
134 /*Table structure for table `wms_ware_sku` */
135 
136 DROP TABLE IF EXISTS `wms_ware_sku`;
137 
138 CREATE TABLE `wms_ware_sku` (
139   `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT 'id',
140   `sku_id` bigint(20) DEFAULT NULL COMMENT 'sku_id',
141   `ware_id` bigint(20) DEFAULT NULL COMMENT '仓库id',
142   `stock` int(11) DEFAULT NULL COMMENT '库存数',
143   `sku_name` varchar(200) DEFAULT NULL COMMENT 'sku_name',
144   `stock_locked` int(11) DEFAULT '0' COMMENT '锁定库存',
145   PRIMARY KEY (`id`),
146   KEY `sku_id` (`sku_id`) USING BTREE,
147   KEY `ware_id` (`ware_id`) USING BTREE
148 ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='商品库存';
149 
150 /*Data for the table `wms_ware_sku` */
151 
152 /*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
153 /*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
154 /*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
155 /*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;

至此,数据库创建完成。

使用Powerdesigner软件设计表数据及表结构,所有的数据库数据再复杂也不建立外键,因为在电商系统里,数据量大,做外键关联很耗性能。生成数据库脚本。sqlyog中,在左侧root上右键建立数据库,字符集选utf8mb4,能兼容utf8且能解决一些乱码的问题,分别建立了以下数据库:gulimall_oms、gulimall_pms、gulimall_sms、gulimall_ums、gulimall_wms

posted @ 2022-03-28 01:06  明明改变世界  阅读(235)  评论(0编辑  收藏  举报