Commit 657e4d035bf9d1c430528bd24d3421efd84b2d63
1 parent
27912729
spu,sku表结构同步
Showing
1 changed file
with
84 additions
and
1 deletions
sql/mall.sql
| ... | ... | @@ -109,4 +109,87 @@ CREATE TABLE `market_activity` ( |
| 109 | 109 | `deleted` bit(1) NOT NULL DEFAULT b'0' COMMENT '是否删除', |
| 110 | 110 | `tenant_id` bigint NOT NULL DEFAULT '0' COMMENT '租户编号', |
| 111 | 111 | PRIMARY KEY (`id`) USING BTREE |
| 112 | -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='促销活动'; | |
| 113 | 112 | \ No newline at end of file |
| 113 | +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='促销活动'; | |
| 114 | + | |
| 115 | + | |
| 116 | +-- 规格名称表 | |
| 117 | +drop table if exists product_attr_key; | |
| 118 | +create table product_attr_key | |
| 119 | +( | |
| 120 | + id int comment '主键', | |
| 121 | + create_time datetime default current_timestamp comment '创建时间', | |
| 122 | + update_time datetime default current_timestamp on update current_timestamp comment '更新时间', | |
| 123 | + creator varchar(64) comment '创建人', | |
| 124 | + updater varchar(64) comment '更新人', | |
| 125 | + deleted bit(1) comment '状态', | |
| 126 | + attr_name varchar(64) comment '规格名称', | |
| 127 | + status tinyint comment '状态: 1 开启 ,2 禁用', | |
| 128 | + primary key (id), | |
| 129 | + key idx_name (attr_name(32)) comment '规格名称索引' | |
| 130 | +) comment '规格名称' character set utf8mb4 | |
| 131 | + collate utf8mb4_general_ci; | |
| 132 | + | |
| 133 | +-- 规格值表 | |
| 134 | +drop table if exists product_attr_value; | |
| 135 | +create table product_attr_value | |
| 136 | +( | |
| 137 | + id int comment '主键', | |
| 138 | + create_time datetime default current_timestamp comment '创建时间', | |
| 139 | + update_time datetime default current_timestamp on update current_timestamp comment '更新时间', | |
| 140 | + creator varchar(64) comment '创建人', | |
| 141 | + updater varchar(64) comment '更新人', | |
| 142 | + deleted bit(1) comment '状态', | |
| 143 | + attr_key_id varchar(64) comment '规格键id', | |
| 144 | + attr_value_name varchar(128) comment '规格值名字', | |
| 145 | + status tinyint comment '状态: 1 开启 ,2 禁用', | |
| 146 | + primary key (id) | |
| 147 | +) comment '规格值' character set utf8mb4 | |
| 148 | + collate utf8mb4_general_ci; | |
| 149 | + | |
| 150 | +-- spu | |
| 151 | +drop table if exists product_spu; | |
| 152 | +create table product_spu | |
| 153 | +( | |
| 154 | + id int comment '主键', | |
| 155 | + create_time datetime default current_timestamp comment '创建时间', | |
| 156 | + update_time datetime default current_timestamp on update current_timestamp comment '更新时间', | |
| 157 | + creator varchar(64) comment '创建人', | |
| 158 | + updater varchar(64) comment '更新人', | |
| 159 | + deleted bit(1) comment '状态', | |
| 160 | + name varchar(128) comment '商品名称', | |
| 161 | + visible bit(1) comment '上下架状态: true 上架,false 下架', | |
| 162 | + sell_point varchar(128) not null comment '卖点', | |
| 163 | + description text not null comment '描述', | |
| 164 | + cid int not null comment '分类id', | |
| 165 | + list_pic_url varchar(128) comment '列表图', | |
| 166 | + pic_urls varchar(1024) not null default '' comment '商品主图地址, 数组,以逗号分隔, 最多上传15张', | |
| 167 | + sort int not null default 0 comment '排序字段', | |
| 168 | + like_count int comment '点赞初始人数', | |
| 169 | + price int comment '价格', | |
| 170 | + quantity int comment '库存数量', | |
| 171 | + primary key (id) | |
| 172 | +) comment '商品spu' character set utf8mb4 | |
| 173 | + collate utf8mb4_general_ci; | |
| 174 | + | |
| 175 | + | |
| 176 | +-- sku | |
| 177 | +drop table if exists product_sku; | |
| 178 | +create table product_sku | |
| 179 | +( | |
| 180 | + id int comment '主键', | |
| 181 | + create_time datetime default current_timestamp comment '创建时间', | |
| 182 | + update_time datetime default current_timestamp on update current_timestamp comment '更新时间', | |
| 183 | + creator varchar(64) comment '创建人', | |
| 184 | + updater varchar(64) comment '更新人', | |
| 185 | + deleted bit(1) comment '状态', | |
| 186 | + spu_id int not null comment 'spu编号', | |
| 187 | + sku_status tinyint comment '状态: 1-正常 2-禁用', | |
| 188 | + attrs varchar(64) not null comment '规格值数组, 以逗号隔开', | |
| 189 | + price int not null DEFAULT -1 comment '销售价格,单位:分', | |
| 190 | + original_price int not null DEFAULT -1 comment '原价, 单位: 分', | |
| 191 | + cost_price int not null DEFAULT -1 comment '成本价,单位: 分', | |
| 192 | + bar_code varchar(64) not null comment '条形码', | |
| 193 | + pic_url VARCHAR(128) not null comment '图片地址', | |
| 194 | + primary key (id) | |
| 195 | +) comment '商品sku' character set utf8mb4 | |
| 196 | + collate utf8mb4_general_ci; | |
| 114 | 197 | \ No newline at end of file | ... | ... |