Showing
1 changed file
with
324 additions
and
327 deletions
1 | ---erp_supplier库: | ||
2 | ---1、base_product: | ||
3 | -ALTER TABLE `erp_supplier`.`base_product` | ||
4 | -CHANGE COLUMN `grade` `grade` char(20) DEFAULT NULL COMMENT '重点款型(是:1,否:null)', | ||
5 | -ADD COLUMN `factory_code` varchar(100) DEFAULT '' COMMENT '厂家编号' AFTER `brand_folder`, | ||
6 | -ADD COLUMN `age_level` varchar(50) DEFAULT '' COMMENT '年龄层(1成人 2大童 3小童 逗号分隔)' AFTER `factory_code`, | ||
7 | -MODIFY COLUMN `goods_season` smallint(5) NULL DEFAULT 0 COMMENT '1:春2:夏3:秋4:冬5:春夏6:秋冬' AFTER `goods_years`, | ||
8 | -ADD COLUMN `is_vip` enum('Y','N','B') NULL DEFAULT 'B' COMMENT '是否VIP Y:是N:否B:品牌设置' AFTER `age_level`, | ||
9 | -ADD COLUMN `is_limitbuy` enum('Y','N') NULL DEFAULT 'N' COMMENT '是否限购' AFTER `is_vip`, | ||
10 | -ADD COLUMN `limit_start_time` int(10) UNSIGNED NULL DEFAULT 0 COMMENT '限购开始时间' AFTER `is_limitbuy`, | ||
11 | -ADD COLUMN `limit_end_time` int(10) NULL DEFAULT 0 COMMENT '限购结束时间' AFTER `limit_start_time`, | ||
12 | -ADD COLUMN `expect_shelf_time` int(10) NULL DEFAULT 0 COMMENT '预计上架时间' AFTER `limit_end_time`, | ||
13 | -ADD COLUMN `is_outlets` enum('Y','N','B') NULL DEFAULT 'B' COMMENT '是否奥莱 Y:是N:否B:品牌设置' AFTER `expect_shelf_time`, | ||
14 | -ADD COLUMN `seasons` varchar(100) DEFAULT '' COMMENT '适销季 夏:summer 冬:winter 四季:seasons', | ||
15 | -ADD COLUMN `reason` varchar(255) DEFAULT '' COMMENT '审批驳回原因', | ||
16 | -ADD COLUMN `editId` int(10) COMMENT '修改人id', | ||
17 | -ADD COLUMN `audit_pass_id` int(10) COMMENT '审核通过人id', | ||
18 | -ADD COLUMN `audit_pass_time` int(10) NULL DEFAULT 0 COMMENT '审核通过时间', | ||
19 | -ADD COLUMN `audit_fail_id` int(10) COMMENT '审核不通过人id', | ||
20 | -ADD COLUMN `audit_fail_time` int(10) NULL DEFAULT 0 COMMENT '审核不通过时间', | ||
21 | -ADD COLUMN `operate_info` varchar(255) DEFAULT '' COMMENT '操作信息'; | ||
22 | - | ||
23 | - | ||
24 | ---/**建立索引***/ | ||
25 | -ALTER TABLE `erp_supplier`.`base_product` | ||
26 | -ADD INDEX `brand_id` (`brand_id`) comment '', | ||
27 | -ADD INDEX `shop_id` (`shop_id`) comment '', | ||
28 | -ADD INDEX `supplier_id` (`supplier_id`) comment '', | ||
29 | -ADD INDEX `is_auditing` (`is_auditing`) comment '', | ||
30 | -ADD INDEX `attribute` (`attribute`) comment '', | ||
31 | -ADD INDEX `is_jit` (`is_jit`) comment '', | ||
32 | -ADD INDEX `is_advance` (`is_advance`) comment '', | ||
33 | -ADD INDEX `is_outlets` (`is_outlets`) comment ''; | ||
34 | - | ||
35 | ---2、base_goods: | ||
36 | -ALTER TABLE `erp_supplier`.`base_goods` | ||
37 | -ADD COLUMN `factory_goods_name` varchar(50) COMMENT '厂家颜色' AFTER `goods_name`; | ||
38 | - | ||
39 | - | ||
40 | ---3、base_single: | ||
41 | - | ||
42 | -ALTER TABLE `erp_supplier`.`base_single` | ||
43 | -ADD COLUMN `is_suppled` enum('N','Y') DEFAULT 'Y' COMMENT '能否补货' AFTER `size_id`, | ||
44 | -ADD COLUMN `presale_storage_num` int(11) unsigned DEFAULT '0' COMMENT '预售库存' AFTER `bar_code`, | ||
45 | -ADD INDEX `is_suppled` (`is_suppled`) comment ''; | ||
46 | - | ||
47 | - | ||
48 | - | ||
49 | - | ||
50 | - | ||
51 | - | ||
52 | - | ||
53 | - | ||
54 | - | ||
55 | - | ||
56 | - | ||
57 | - | ||
58 | - | ||
59 | --- erp_product库: | ||
60 | ---1、product: | ||
61 | - | ||
62 | -ALTER TABLE `erp_product`.`product` | ||
63 | -ADD COLUMN `goods_years` smallint(5) DEFAULT 0, | ||
64 | -ADD COLUMN `goods_season` smallint(5) DEFAULT 0 COMMENT '1:春2:夏3:秋4:冬5:春夏6:秋冬' AFTER `goods_years`, | ||
65 | -ADD COLUMN `limit_start_time` int(10) UNSIGNED DEFAULT 0 COMMENT '限购开始时间' AFTER `brand_folder`, | ||
66 | -ADD COLUMN `limit_end_time` int(10) UNSIGNED DEFAULT 0 COMMENT '限购结束时间' AFTER `limit_start_time`, | ||
67 | -ADD COLUMN `expect_shelf_time` int(10) UNSIGNED DEFAULT 0 COMMENT '预计上架时间' AFTER `limit_end_time`, | ||
68 | -ADD COLUMN `factory_code` varchar(100) DEFAULT '' COMMENT '厂家编号' AFTER `expect_shelf_time`, | ||
69 | -ADD COLUMN `age_level` varchar(50) DEFAULT '1' COMMENT '年龄层(1成人 2大童 3小童 逗号分隔)' AFTER `factory_code`, | ||
70 | -CHANGE COLUMN `grade` `grade` char(20) DEFAULT NULL COMMENT '重点款型(是:K,否:null)', | ||
71 | -MODIFY COLUMN `is_outlets` enum('Y','N','B') DEFAULT 'B' COMMENT '是否奥莱 Y:是N:否B:品牌设置' AFTER `is_promotion`, | ||
72 | -ADD COLUMN `is_promotional_gifts` enum('Y','N') DEFAULT 'N' AFTER `goods_season`, | ||
73 | -ADD COLUMN `is_vip` enum('Y','N','B') DEFAULT 'B' COMMENT '是否VIP Y:是N:否B:品牌设置' AFTER `is_promotional_gifts`, | ||
74 | -ADD COLUMN `is_limitbuy` enum('Y','N') DEFAULT 'N' COMMENT '是否限购' AFTER `is_vip`, | ||
75 | -ADD COLUMN `audit_pass_id` int(10) COMMENT '审核通过人id', | ||
76 | -ADD COLUMN `audit_pass_time` int(10) NULL DEFAULT 0 COMMENT '审核通过时间', | ||
77 | -ADD COLUMN `audit_fail_id` int(10) COMMENT '审核不通过人id', | ||
78 | -ADD COLUMN `audit_fail_time` int(10) NULL DEFAULT 0 COMMENT '审核不通过时间', | ||
79 | -ADD COLUMN `operate_info` varchar(255) DEFAULT '' COMMENT '操作信息'; | ||
80 | - | ||
81 | - | ||
82 | ---/***添加索引****/ | ||
83 | -ALTER TABLE `erp_product`.`product` | ||
84 | -ADD INDEX `brand_id` (`brand_id`) comment '', | ||
85 | -ADD INDEX `shop_id` (`shop_id`) comment '', | ||
86 | -ADD INDEX `supplier_id` (`supplier_id`) comment '', | ||
87 | -ADD INDEX `attribute` (`attribute`) comment '', | ||
88 | -ADD INDEX `is_jit` (`is_jit`) comment '', | ||
89 | -ADD INDEX `is_outlets` (`is_outlets`) comment '', | ||
90 | -ADD INDEX `is_advance` (`is_advance`) comment ''; | ||
91 | - | ||
92 | ---2、goods: | ||
93 | -ALTER TABLE `erp_product`.`goods` | ||
94 | -ADD COLUMN `factory_goods_name` varchar(50) COMMENT '厂家颜色' AFTER `goods_name`; | ||
95 | - | ||
96 | ---3、storage: | ||
97 | - | ||
98 | -ALTER TABLE `erp_product`.`storage` | ||
99 | -ADD COLUMN `is_suppled` enum('Y','N') DEFAULT 'Y' COMMENT '能否补货' AFTER `update_time`, | ||
100 | -ADD COLUMN `presale_storage_num` int(11) unsigned DEFAULT '0' COMMENT '预售库存' AFTER `bar_code`, | ||
101 | -ADD INDEX `is_suppled` (`is_suppled`) comment ''; | ||
102 | - | ||
103 | - | ||
104 | -ALTER TABLE `erp_product`.`storage` | ||
105 | -DROP COLUMN `presale_storage_num`; | ||
106 | - | ||
107 | - | ||
108 | ---4、product_price: | ||
109 | - | ||
110 | -ALTER TABLE `erp_product`.`product_price` | ||
111 | -CHANGE COLUMN `founder` `founder` int(11) UNSIGNED DEFAULT 0 COMMENT '操作人ID', | ||
112 | -ADD COLUMN `enable_vip` tinyint(3) UNSIGNED DEFAULT 2 COMMENT '是否享受vip折扣:1 根据品牌设置进行折扣 2 开启 3 关闭' AFTER `founder`; | ||
113 | - | ||
114 | - | ||
115 | -alter table erp_product.product add column is_screen enum('Y', 'N') default 'N' COMMENT '是否已拍摄标识'; | ||
116 | -alter table erp_product.product add column is_measure enum('Y', 'N') default 'N' COMMENT '是否已测量标识'; | ||
117 | -alter table erp_product.product add column status smallint default 1 COMMENT ' 8待上架,2待审核,3驳回,4通过,1已上架,0已下架,5再上架待审核,6再上架驳回,7再上架通过'; | ||
118 | -alter table erp_product.product add column first_shelve_time int(10) unsigned DEFAULT '0' COMMENT '首次上架时间'; | ||
119 | -alter table erp_product.product add column shelve_time int(10) unsigned DEFAULT '0' COMMENT '上架时间可作为上新参考'; | ||
120 | -alter table erp_product.product add column `stock` smallint(6) DEFAULT 0 COMMENT '库存'; | ||
121 | -alter table erp_product.product add column `next_status` smallint COMMENT '下一流程状态'; | ||
122 | -Alter table erp_product.product ADD column `founder` int(11) COMMENT '操作人'; | ||
123 | -Alter table erp_product.product ADD column `is_info_miss` enum('Y', 'N') default 'Y' COMMENT '是否信息缺失'; | ||
124 | -create index product_edittime on product(`edit_time`); | ||
125 | - | ||
126 | -create table product_ext( | ||
127 | - product_skn int COMMENT '商品erp标识', | ||
128 | - product_desc text COMMENT '描述', -- 废弃 | ||
129 | - recommend text COMMENT '小编推荐', -- 新增字段 | ||
130 | - is_hostsell enum('Y', 'N') default 'N' COMMENT '是否热销 Y:是N:否', -- 需要割接 之前直接操作的前台表yh_shops.is_hot | ||
131 | - sales_phrase varchar(100) COMMENT '促销短语', -- 需要割接 之前直接操作的前台表yh_shops.sales_phrase | ||
132 | - is_new enum('Y', 'N') default 'N' COMMENT '是否新品 Y:是N:否', -- 需要割接 之前直接操作的前台表yh_shops.is_hot | ||
133 | - shelves_day int COMMENT '售罄后几天后下架', -- 废弃 | ||
134 | - sell_channels set('0','1','2','3','4','5','6','7','8','9') COMMENT '上架渠道', -- 需要割接 之前直接操作的前台表yh_shops.sell_channels | ||
135 | - phrase varchar(500) COMMENT '商品短评', -- 需要割接 之前直接操作的前台表yh_shops.phrase | ||
136 | - search_keys varchar(500) COMMENT '搜索关键词 以英文逗号分隔', -- | ||
137 | - vedio_url varchar(100) COMMENT '视频链接', -- 新增字段 | ||
138 | - make_crafts varchar(50) COMMENT '制作工艺', -- 新增字段 | ||
139 | - brand_series varchar(50) COMMENT '品牌系列', -- 新增字段 | ||
140 | - brand_model varchar(50) COMMENT '品牌款型', -- 新增字段 | ||
141 | - reject_reason varchar(500) COMMENT '驳回原因' -- 无需同步 | ||
142 | -)ENGINE=INNODB DEFAULT CHARSET=utf8; | ||
143 | -Alter table product_ext add primary key(product_skn); | ||
144 | - | ||
145 | --- 变价表和变价日志表 | ||
146 | -alter table erp_product.product_price modify `founder` int(11) unsigned DEFAULT '0' COMMENT '操作人ID'; | ||
147 | -alter table erp_product.product_price_log modify `founder` int(11) unsigned DEFAULT '0' COMMENT '操作人ID'; | ||
148 | - | ||
149 | - | ||
150 | --- 1.4 缺失信息维护 | ||
151 | - | ||
152 | --- 网销信息缺失类型的全量枚举表(无需同步) | ||
153 | --- DROP TABLE IF EXISTS `netsale_infomiss`; | ||
154 | - CREATE TABLE netsale_infomiss ( | ||
155 | - `id` int(11) unsigned NOT NULL AUTO_INCREMENT, | ||
156 | - `name` varchar(100) DEFAULT NULL, | ||
157 | - PRIMARY KEY (`id`) | ||
158 | - ) ENGINE=INNODB DEFAULT CHARSET=utf8 COMMENT '网销信息缺失类型的全量枚举表'; | ||
159 | - | ||
160 | - insert into netsale_infomiss (name) values('文本信息'),('尺码信息'),('搜索/标签'); | ||
161 | - | ||
162 | --- 商品和网销信息缺失表的关联关系表(无需同步) | ||
163 | --- DROP TABLE IF EXISTS `netsale_infomiss_relation`; | ||
164 | - CREATE TABLE netsale_infomiss_relation ( | ||
165 | - `product_skn` int(11) unsigned NOT NULL, | ||
166 | - `infomiss_id` int(11) unsigned NOT NULL COMMENT 'netsale_infomiss_sort 的主键', | ||
167 | - PRIMARY KEY (`product_skn`, infomiss_id) | ||
168 | - ) ENGINE=INNODB DEFAULT CHARSET=utf8 COMMENT '网销信息缺失类型和商品的关系表'; | ||
169 | - | ||
170 | --- erp_product | ||
171 | --- 产品参数 | ||
172 | -CREATE TABLE `product_attribute` ( | ||
173 | - `attribute_id` int(11) unsigned NOT NULL AUTO_INCREMENT, | ||
174 | - `attribute_name` varchar(100) DEFAULT NULL, | ||
175 | - `category_id` int(11) unsigned NOT NULL DEFAULT '0', | ||
176 | - `sale_type` int(11) unsigned DEFAULT '0' COMMENT '1:销售属性 2:非销售属性 3:扩展属性', | ||
177 | - `input_type` enum('radio','checkbox','select','text','textarea') DEFAULT NULL COMMENT 'radio 单选\n checkbox 复选\n select 下拉列表\n text 输入框\n textarea 多行输入', | ||
178 | - `attribute_type` tinyint(3) unsigned DEFAULT NULL COMMENT '1 - 可销售属性\n 2 - 非可销售属性\n 3 - 扩展属性', | ||
179 | - `is_must` enum('Y','N') DEFAULT 'N', | ||
180 | - `is_search` enum('Y','N') DEFAULT 'Y', | ||
181 | - `max_value_len` smallint(5) unsigned DEFAULT '50', | ||
182 | - `is_color` enum('Y','N') DEFAULT 'N', | ||
183 | - `is_allow_alias` enum('Y','N') DEFAULT 'N', | ||
184 | - `order_by` int(11) unsigned DEFAULT '0', | ||
185 | - `state` tinyint(3) unsigned DEFAULT '1', | ||
186 | - `remark` varchar(500) DEFAULT NULL, | ||
187 | - `attribute_values` varchar(1000) DEFAULT NULL COMMENT '红色,白色,黑色', | ||
188 | - `belong` tinyint(3) unsigned DEFAULT '10' COMMENT '10系统\n 20商家', | ||
189 | - `create_time` int(10) unsigned DEFAULT NULL, | ||
190 | - `display_position` int(1) unsigned DEFAULT '1' COMMENT '1:基础商品-非销售属性 2:网销信息-上架后补全信息 3:网销信息-商品参数', | ||
191 | - PRIMARY KEY (`attribute_id`) | ||
192 | -) ENGINE=InnoDB AUTO_INCREMENT=72 DEFAULT CHARSET=utf8; | ||
193 | - | ||
194 | - | ||
195 | -INSERT INTO `product_attribute`(attribute_id,`attribute_name`,`category_id`,`input_type`,`sale_type`,`attribute_values`,`display_position`)VALUES(2001,'弹性',0,'select',2,'[{\"id\":1,\"name\":\"1\"},{\"id\":2,\"name\":\"2\"},{\"id\":3,\"name\":\"3\"},{\"id\":4,\"name\":\"4\"},{\"id\":5,\"name\":\"5\"}]', 2); | ||
196 | -INSERT INTO `product_attribute`(attribute_id,`attribute_name`,`category_id`,`input_type`,`sale_type`,`attribute_values`,`display_position`)VALUES(2002,'厚度',0,'select',2,'[{\"id\":1,\"name\":\"1\"},{\"id\":2,\"name\":\"2\"},{\"id\":3,\"name\":\"3\"},{\"id\":4,\"name\":\"4\"},{\"id\":5,\"name\":\"5\"}]', 2); | ||
197 | -INSERT INTO `product_attribute`(attribute_id,`attribute_name`,`category_id`,`input_type`,`sale_type`,`attribute_values`,`display_position`)VALUES(2003,'柔软度',0,'select',2,'[{\"id\":1,\"name\":\"1\"},{\"id\":2,\"name\":\"2\"},{\"id\":3,\"name\":\"3\"},{\"id\":4,\"name\":\"4\"},{\"id\":5,\"name\":\"5\"}]', 2); | ||
198 | -INSERT INTO `product_attribute`(attribute_id,`attribute_name`,`category_id`,`input_type`,`sale_type`,`attribute_values`,`display_position`)VALUES(2004,'透气性',0,'select',2,'[{\"id\":1,\"name\":\"1\"},{\"id\":2,\"name\":\"2\"},{\"id\":3,\"name\":\"3\"},{\"id\":4,\"name\":\"4\"},{\"id\":5,\"name\":\"5\"}]', 2); | ||
199 | -INSERT INTO `product_attribute`(attribute_id,`attribute_name`,`category_id`, `input_type`,`sale_type`,`attribute_values`,`display_position`)VALUES(2005,'洗涤提示',0,'checkbox',2,'[{\"id\":1,\"name\":\"不可熨烫\"},{\"id\":2,\"name\":\"不可转笼翻转干燥\"},{\"id\":3,\"name\":\"30度水温弱速洗\"},{\"id\":4,\"name\":\"不可氯漂\"},{\"id\":5,\"name\":\"不可干洗\"},{\"id\":6,\"name\":\"不可拧干\"},{\"id\":7,\"name\":\"分色洗涤\"}]', 3); | ||
200 | - | ||
201 | - | ||
202 | - | ||
203 | - | ||
204 | - | ||
205 | - | ||
206 | - | ||
207 | - | ||
208 | - | ||
209 | - | ||
210 | - | ||
211 | - | ||
212 | - | ||
213 | - | ||
214 | - | ||
215 | --- 2 yh_shops 库 | ||
216 | --- 2.1 商品的展示店铺 | ||
217 | -create table product_shop_relation( | ||
218 | - product_skn int COMMENT 'SKN', | ||
219 | - shop_id int COMMENT '店铺Id' | ||
220 | -); | ||
221 | -Alter table product_shop_relation add primary key(product_skn, shop_id); | ||
222 | - | ||
223 | --- 标识商品是否是新平台的商品 | ||
224 | -alter table yh_shops.product add column source_flag enum('0', '1') default '0' COMMENT '新平台发布的商品为1 原来则为0'; | ||
225 | - | ||
226 | - | ||
227 | - | ||
228 | - | ||
229 | - | ||
230 | - | ||
231 | - | ||
232 | --- 2.5 预上架上新记录表 | ||
233 | - Alter table product_timing ADD column `product_skn` int(11) unsigned default 0; | ||
234 | - Alter table product_timing ADD column `advance_begin_time` int(10) unsigned; -- 预售开始时间 | ||
235 | - Alter table product_timing ADD column `advance_end_time` int(10) unsigned; -- 预售结束时间 | ||
236 | - Alter table product_timing ADD column `on_new_time` int(10) unsigned; -- 预上架上新时间 | ||
237 | - Alter table product_timing ADD column `out_sale_time` int(10) unsigned; -- 售罄后几天下架时间 | ||
238 | - create index timing_skn on product_timing(`product_skn`); | ||
239 | - Alter table product_timing modify column shelve_time int(10) unsigned COMMENT '预上架架时间'; | ||
240 | - | ||
241 | - | ||
242 | - | ||
243 | - | ||
244 | --- 2.8 平台商品属性值表 | ||
245 | - | ||
246 | - CREATE TABLE product_attribute_property_values ( | ||
247 | - `id` int(11) unsigned NOT NULL AUTO_INCREMENT, | ||
248 | - `product_skn` int(11) unsigned NOT NULL, | ||
249 | - `attribute_id` int(11) unsigned NOT NULL COMMENT '品类属性ID', | ||
250 | - `attribute_value_id` int(11) unsigned NOT NULL COMMENT '品类属性值ID', | ||
251 | - `display_position` int(1) unsigned DEFAULT '1' COMMENT '1:基础商品-非销售属性 2:网销信息-上架后补全信息 3:网销信息-商品参数', | ||
252 | - PRIMARY KEY (`id`), | ||
253 | - KEY `attribute_pro_skn_attrid` (`product_skn`,`attribute_id`) | ||
254 | - ) ENGINE=INNODB DEFAULT CHARSET=utf8 COMMENT '平台商品属性值表'; | ||
255 | - | ||
256 | - | ||
257 | - | ||
258 | - | ||
259 | --- yh_shops | ||
260 | -ALTER TABLE yh_shops.product_standard_relation ADD COLUMN product_skn INT(11) UNSIGNED; | ||
261 | - | ||
262 | -ALTER TABLE yh_shops.`product_collocation` ADD COLUMN product_skn INT(11) UNSIGNED ; | ||
263 | - | ||
264 | --- brand_folder | ||
265 | -ALTER TABLE yh_shops.brand_folder ADD shops_id INT(11) UNSIGNED COMMENT '店铺id'; | ||
266 | -ALTER TABLE yh_shops.brand_folder ADD `create_time` int(10) unsigned DEFAULT '0' COMMENT '创建时间'; | ||
267 | -ALTER TABLE yh_shops.brand_folder ADD `update_time` int(10) unsigned DEFAULT '0' COMMENT '修改时间'; | ||
268 | -ALTER TABLE yh_shops.brand_folder CHANGE parent_id parent_id INT(11) UNSIGNED null ; | ||
269 | -ALTER TABLE yh_shops.brand_folder CHANGE order_by order_by SMALLINT(6) null; | ||
270 | --- brand_series | ||
271 | -ALTER TABLE yh_shops.`brand_series` ADD shops_id INT(11) UNSIGNED COMMENT '店铺id'; | ||
272 | -ALTER TABLE yh_shops.`brand_series` ADD `create_time` int(10) unsigned DEFAULT '0' COMMENT '创建时间'; | ||
273 | -ALTER TABLE yh_shops.`brand_series` ADD `update_time` int(10) unsigned DEFAULT '0' COMMENT '修改时间'; | ||
274 | - -- add key | ||
275 | -ALTER TABLE yh_shops.`brand_series` ADD KEY key_shops_id (shops_id); | ||
276 | -ALTER TABLE yh_shops.`brand_series` ADD KEY key_brand_id (brand_id); | ||
277 | --- set null | ||
278 | -ALTER TABLE yh_shops.brand_series CHANGE parent_id parent_id INT(11) UNSIGNED null ; | ||
279 | -ALTER TABLE yh_shops.brand_series CHANGE order_by order_by SMALLINT(6) null; | ||
280 | - | ||
281 | - | ||
282 | -ALTER TABLE `yh_shops`.`product` | ||
283 | -ADD COLUMN `limit_start_time` int(10) UNSIGNED DEFAULT 0 COMMENT '限购开始时间', | ||
284 | -ADD COLUMN `limit_end_time` int(10) UNSIGNED DEFAULT 0 COMMENT '限购结束时间' AFTER `limit_start_time`, | ||
285 | -ADD COLUMN `expect_shelf_time` int(10) UNSIGNED DEFAULT 0 COMMENT '预计上架时间' AFTER `limit_end_time`, | ||
286 | -ADD COLUMN `product_code` varchar(100) DEFAULT '' COMMENT '厂家编号' AFTER `expect_shelf_time`, | ||
287 | -ADD COLUMN `age_level` varchar(50) DEFAULT '' COMMENT '年龄层(1成人 2大童 3小童 逗号分隔)' AFTER `product_code`, | ||
288 | -ADD COLUMN `goods_years` smallint(5) DEFAULT '0' COMMENT '货品年', | ||
289 | -ADD COLUMN `goods_season` smallint(5) DEFAULT '0' COMMENT '货品季', | ||
290 | -MODIFY COLUMN `is_outlets` enum('Y','N') DEFAULT 'N' COMMENT '是否奥莱 Y:是N:否', | ||
291 | -ADD COLUMN `outlets_setting` enum('B','N','S') DEFAULT 'N' COMMENT '奥特莱斯设置B:品牌设置;S:店铺设置,N:不设置', | ||
292 | -ADD COLUMN `is_promotional_gifts` enum('Y','N') DEFAULT 'N' AFTER `goods_season`; | ||
293 | -ALTER TABLE `product` | ||
294 | -MODIFY COLUMN `is_outlets` enum('Y','B','N') CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT 'N' COMMENT '是否奥莱 Y:是N:否' AFTER `storage`; | ||
295 | - | ||
296 | -ALTER TABLE `product` | ||
297 | -ADD COLUMN `series` varchar(100) NULL DEFAULT NULL AFTER `outlets_setting`, | ||
298 | -ADD COLUMN `models` varchar(100) NULL DEFAULT NULL AFTER `series`, | ||
299 | -ADD COLUMN `product_tag` varchar(100) NULL DEFAULT NULL AFTER `models`, | ||
300 | -ADD COLUMN `product_elements` varchar(200) NULL DEFAULT NULL AFTER `product_tag`, | ||
301 | -ADD COLUMN `product_style` varchar(200) NULL AFTER `product_elements`, | ||
302 | -ADD COLUMN `grade` char(20) NULL DEFAULT NULL COMMENT '重点款型(是:K,否:null)' AFTER `product_style`, | ||
303 | -ADD COLUMN `brand_folder` int(5) NULL DEFAULT NULL AFTER `grad; | ||
304 | - | ||
305 | - | ||
306 | -ALTER TABLE `storage` | ||
307 | -ADD COLUMN `factory_code` varchar(100) NULL AFTER `create_time`, | ||
308 | -ADD COLUMN `is_suppled` enum('N','Y') NOT NULL DEFAULT 'Y' COMMENT '能否补货' AFTER `factory_code`, | ||
309 | -ADD COLUMN `product_skc` int(11) NOT NULL DEFAULT 0 AFTER `is_suppled`; | ||
310 | ---------------------- | ||
311 | -ALTER TABLE `goods` | ||
312 | -ADD COLUMN `factory_code` varchar(100) NULL; | ||
313 | --------------------------- | ||
314 | - CREATE TABLE `product_ext` ( | ||
315 | - `product_skn` int(11) NOT NULL DEFAULT '0' COMMENT '商品erp标识', | ||
316 | - `product_desc` text COMMENT '描述', | ||
317 | - `recommend` text COMMENT '小编推荐', | ||
318 | - `is_hostsell` enum('Y','N') DEFAULT 'N' COMMENT '是否热销 Y:是N:否', | ||
319 | - `shelves_day` int(11) DEFAULT NULL COMMENT '售罄后几天后下架', | ||
320 | - `search_keys` varchar(500) DEFAULT NULL COMMENT '搜索关键词 以英文逗号分隔', | ||
321 | - `vedio_url` varchar(100) DEFAULT NULL COMMENT '视频链接', | ||
322 | - `make_crafts` varchar(50) DEFAULT NULL COMMENT '制作工艺', | ||
323 | - `brand_series` varchar(50) DEFAULT NULL COMMENT '品牌系列', | ||
324 | - `brand_model` varchar(50) DEFAULT NULL COMMENT '品牌款型', | ||
325 | - `reject_reason` varchar(500) DEFAULT NULL COMMENT '驳回原因', | ||
326 | - PRIMARY KEY (`product_skn`) | ||
327 | -) ENGINE=MyISAM DEFAULT CHARSET=utf8; | 1 | +--erp_supplier库: |
2 | +--1、base_product: | ||
3 | +ALTER TABLE `erp_supplier`.`base_product` | ||
4 | +CHANGE COLUMN `grade` `grade` char(20) DEFAULT NULL COMMENT '重点款型(是:1,否:null)', | ||
5 | +ADD COLUMN `factory_code` varchar(100) DEFAULT '' COMMENT '厂家编号' AFTER `brand_folder`, | ||
6 | +ADD COLUMN `age_level` varchar(50) DEFAULT '' COMMENT '年龄层(1成人 2大童 3小童 逗号分隔)' AFTER `factory_code`, | ||
7 | +MODIFY COLUMN `goods_season` smallint(5) NULL DEFAULT 0 COMMENT '1:春2:夏3:秋4:冬5:春夏6:秋冬' AFTER `goods_years`, | ||
8 | +ADD COLUMN `is_vip` enum('Y','N','B') NULL DEFAULT 'B' COMMENT '是否VIP Y:是N:否B:品牌设置' AFTER `age_level`, | ||
9 | +ADD COLUMN `is_limitbuy` enum('Y','N') NULL DEFAULT 'N' COMMENT '是否限购' AFTER `is_vip`, | ||
10 | +ADD COLUMN `limit_start_time` int(10) UNSIGNED NULL DEFAULT 0 COMMENT '限购开始时间' AFTER `is_limitbuy`, | ||
11 | +ADD COLUMN `limit_end_time` int(10) NULL DEFAULT 0 COMMENT '限购结束时间' AFTER `limit_start_time`, | ||
12 | +ADD COLUMN `expect_shelf_time` int(10) NULL DEFAULT 0 COMMENT '预计上架时间' AFTER `limit_end_time`, | ||
13 | +ADD COLUMN `is_outlets` enum('Y','N','B') NULL DEFAULT 'B' COMMENT '是否奥莱 Y:是N:否B:品牌设置' AFTER `expect_shelf_time`, | ||
14 | +ADD COLUMN `seasons` varchar(100) DEFAULT '' COMMENT '适销季 夏:summer 冬:winter 四季:seasons', | ||
15 | +ADD COLUMN `reason` varchar(255) DEFAULT '' COMMENT '审批驳回原因', | ||
16 | +ADD COLUMN `editId` int(10) COMMENT '修改人id', | ||
17 | +ADD COLUMN `audit_pass_id` int(10) COMMENT '审核通过人id', | ||
18 | +ADD COLUMN `audit_pass_time` int(10) NULL DEFAULT 0 COMMENT '审核通过时间', | ||
19 | +ADD COLUMN `audit_fail_id` int(10) COMMENT '审核不通过人id', | ||
20 | +ADD COLUMN `audit_fail_time` int(10) NULL DEFAULT 0 COMMENT '审核不通过时间', | ||
21 | +ADD COLUMN `operate_info` varchar(255) DEFAULT '' COMMENT '操作信息'; | ||
22 | + | ||
23 | + | ||
24 | +--/**建立索引***/ | ||
25 | +ALTER TABLE `erp_supplier`.`base_product` | ||
26 | +ADD INDEX `brand_id` (`brand_id`) comment '', | ||
27 | +ADD INDEX `shop_id` (`shop_id`) comment '', | ||
28 | +ADD INDEX `supplier_id` (`supplier_id`) comment '', | ||
29 | +ADD INDEX `is_auditing` (`is_auditing`) comment '', | ||
30 | +ADD INDEX `attribute` (`attribute`) comment '', | ||
31 | +ADD INDEX `is_jit` (`is_jit`) comment '', | ||
32 | +ADD INDEX `is_advance` (`is_advance`) comment '', | ||
33 | +ADD INDEX `is_outlets` (`is_outlets`) comment ''; | ||
34 | + | ||
35 | +--2、base_goods: | ||
36 | +ALTER TABLE `erp_supplier`.`base_goods` | ||
37 | +ADD COLUMN `factory_goods_name` varchar(50) COMMENT '厂家颜色' AFTER `goods_name`; | ||
38 | + | ||
39 | + | ||
40 | +--3、base_single: | ||
41 | + | ||
42 | +ALTER TABLE `erp_supplier`.`base_single` | ||
43 | +ADD COLUMN `is_suppled` enum('N','Y') DEFAULT 'Y' COMMENT '能否补货' AFTER `size_id`, | ||
44 | +ADD COLUMN `presale_storage_num` int(11) unsigned DEFAULT '0' COMMENT '预售库存', | ||
45 | +ADD INDEX `is_suppled` (`is_suppled`) comment ''; | ||
46 | + | ||
47 | + | ||
48 | + | ||
49 | + | ||
50 | + | ||
51 | + | ||
52 | + | ||
53 | + | ||
54 | + | ||
55 | + | ||
56 | + | ||
57 | + | ||
58 | + | ||
59 | +-- erp_product库: | ||
60 | +--1、product: | ||
61 | + | ||
62 | +ALTER TABLE `erp_product`.`product` | ||
63 | +ADD COLUMN `goods_years` smallint(5) DEFAULT 0, | ||
64 | +ADD COLUMN `goods_season` smallint(5) DEFAULT 0 COMMENT '1:春2:夏3:秋4:冬5:春夏6:秋冬' AFTER `goods_years`, | ||
65 | +ADD COLUMN `limit_start_time` int(10) UNSIGNED DEFAULT 0 COMMENT '限购开始时间' AFTER `brand_folder`, | ||
66 | +ADD COLUMN `limit_end_time` int(10) UNSIGNED DEFAULT 0 COMMENT '限购结束时间' AFTER `limit_start_time`, | ||
67 | +ADD COLUMN `expect_shelf_time` int(10) UNSIGNED DEFAULT 0 COMMENT '预计上架时间' AFTER `limit_end_time`, | ||
68 | +ADD COLUMN `factory_code` varchar(100) DEFAULT '' COMMENT '厂家编号' AFTER `expect_shelf_time`, | ||
69 | +ADD COLUMN `age_level` varchar(50) DEFAULT '1' COMMENT '年龄层(1成人 2大童 3小童 逗号分隔)' AFTER `factory_code`, | ||
70 | +CHANGE COLUMN `grade` `grade` char(20) DEFAULT NULL COMMENT '重点款型(是:K,否:null)', | ||
71 | +MODIFY COLUMN `is_outlets` enum('Y','N','B') DEFAULT 'B' COMMENT '是否奥莱 Y:是N:否B:品牌设置' AFTER `is_promotion`, | ||
72 | +ADD COLUMN `is_promotional_gifts` enum('Y','N') DEFAULT 'N' AFTER `goods_season`, | ||
73 | +ADD COLUMN `is_vip` enum('Y','N','B') DEFAULT 'B' COMMENT '是否VIP Y:是N:否B:品牌设置' AFTER `is_promotional_gifts`, | ||
74 | +ADD COLUMN `is_limitbuy` enum('Y','N') DEFAULT 'N' COMMENT '是否限购' AFTER `is_vip`, | ||
75 | +ADD COLUMN `audit_pass_id` int(10) COMMENT '审核通过人id', | ||
76 | +ADD COLUMN `audit_pass_time` int(10) NULL DEFAULT 0 COMMENT '审核通过时间', | ||
77 | +ADD COLUMN `audit_fail_id` int(10) COMMENT '审核不通过人id', | ||
78 | +ADD COLUMN `audit_fail_time` int(10) NULL DEFAULT 0 COMMENT '审核不通过时间', | ||
79 | +ADD COLUMN `operate_info` varchar(255) DEFAULT '' COMMENT '操作信息'; | ||
80 | + | ||
81 | + | ||
82 | +--/***添加索引****/ | ||
83 | +ALTER TABLE `erp_product`.`product` | ||
84 | +ADD INDEX `brand_id` (`brand_id`) comment '', | ||
85 | +ADD INDEX `shop_id` (`shop_id`) comment '', | ||
86 | +ADD INDEX `supplier_id` (`supplier_id`) comment '', | ||
87 | +ADD INDEX `attribute` (`attribute`) comment '', | ||
88 | +ADD INDEX `is_jit` (`is_jit`) comment '', | ||
89 | +ADD INDEX `is_outlets` (`is_outlets`) comment '', | ||
90 | +ADD INDEX `is_advance` (`is_advance`) comment ''; | ||
91 | + | ||
92 | +--2、goods: | ||
93 | +ALTER TABLE `erp_product`.`goods` | ||
94 | +ADD COLUMN `factory_goods_name` varchar(50) COMMENT '厂家颜色' AFTER `goods_name`; | ||
95 | + | ||
96 | +--3、storage: | ||
97 | + | ||
98 | +ALTER TABLE `erp_product`.`storage` | ||
99 | +ADD COLUMN `is_suppled` enum('Y','N') DEFAULT 'Y' COMMENT '能否补货' AFTER `update_time`, | ||
100 | +ADD COLUMN `presale_storage_num` int(11) unsigned DEFAULT '0' COMMENT '预售库存' AFTER `bar_code`, | ||
101 | +ADD INDEX `is_suppled` (`is_suppled`) comment ''; | ||
102 | + | ||
103 | + | ||
104 | + | ||
105 | +--4、product_price: | ||
106 | + | ||
107 | +ALTER TABLE `erp_product`.`product_price` | ||
108 | +CHANGE COLUMN `founder` `founder` int(11) UNSIGNED DEFAULT 0 COMMENT '操作人ID', | ||
109 | +ADD COLUMN `enable_vip` tinyint(3) UNSIGNED DEFAULT 2 COMMENT '是否享受vip折扣:1 根据品牌设置进行折扣 2 开启 3 关闭' AFTER `founder`; | ||
110 | + | ||
111 | + | ||
112 | +alter table erp_product.product add column is_screen enum('Y', 'N') default 'N' COMMENT '是否已拍摄标识'; | ||
113 | +alter table erp_product.product add column is_measure enum('Y', 'N') default 'N' COMMENT '是否已测量标识'; | ||
114 | +alter table erp_product.product add column status smallint default 1 COMMENT ' 8待上架,2待审核,3驳回,4通过,1已上架,0已下架,5再上架待审核,6再上架驳回,7再上架通过'; | ||
115 | +alter table erp_product.product add column first_shelve_time int(10) unsigned DEFAULT '0' COMMENT '首次上架时间'; | ||
116 | +alter table erp_product.product add column shelve_time int(10) unsigned DEFAULT '0' COMMENT '上架时间可作为上新参考'; | ||
117 | +alter table erp_product.product add column `stock` smallint(6) DEFAULT 0 COMMENT '库存'; | ||
118 | +alter table erp_product.product add column `next_status` smallint COMMENT '下一流程状态'; | ||
119 | +Alter table erp_product.product ADD column `founder` int(11) COMMENT '操作人'; | ||
120 | +Alter table erp_product.product ADD column `is_info_miss` enum('Y', 'N') default 'Y' COMMENT '是否信息缺失'; | ||
121 | +create index product_edittime on erp_product.product(`edit_time`); | ||
122 | + | ||
123 | +create table erp_product.product_ext( | ||
124 | + product_skn int COMMENT '商品erp标识', | ||
125 | + product_desc text COMMENT '描述', -- 废弃 | ||
126 | + recommend text COMMENT '小编推荐', -- 新增字段 | ||
127 | + is_hostsell enum('Y', 'N') default 'N' COMMENT '是否热销 Y:是N:否', -- 需要割接 之前直接操作的前台表yh_shops.is_hot | ||
128 | + sales_phrase varchar(100) COMMENT '促销短语', -- 需要割接 之前直接操作的前台表yh_shops.sales_phrase | ||
129 | + is_new enum('Y', 'N') default 'N' COMMENT '是否新品 Y:是N:否', -- 需要割接 之前直接操作的前台表yh_shops.is_hot | ||
130 | + shelves_day int COMMENT '售罄后几天后下架', -- 废弃 | ||
131 | + sell_channels set('0','1','2','3','4','5','6','7','8','9') COMMENT '上架渠道', -- 需要割接 之前直接操作的前台表yh_shops.sell_channels | ||
132 | + phrase varchar(500) COMMENT '商品短评', -- 需要割接 之前直接操作的前台表yh_shops.phrase | ||
133 | + search_keys varchar(500) COMMENT '搜索关键词 以英文逗号分隔', -- | ||
134 | + vedio_url varchar(100) COMMENT '视频链接', -- 新增字段 | ||
135 | + make_crafts varchar(50) COMMENT '制作工艺', -- 新增字段 | ||
136 | + brand_series varchar(50) COMMENT '品牌系列', -- 新增字段 | ||
137 | + brand_model varchar(50) COMMENT '品牌款型', -- 新增字段 | ||
138 | + reject_reason varchar(500) COMMENT '驳回原因' -- 无需同步 | ||
139 | +)ENGINE=INNODB DEFAULT CHARSET=utf8; | ||
140 | +Alter table erp_product.product_ext add primary key(product_skn); | ||
141 | + | ||
142 | +-- 变价表和变价日志表 | ||
143 | +alter table erp_product.product_price modify `founder` int(11) unsigned DEFAULT '0' COMMENT '操作人ID'; | ||
144 | +alter table erp_product.product_price_log modify `founder` int(11) unsigned DEFAULT '0' COMMENT '操作人ID'; | ||
145 | + | ||
146 | + | ||
147 | +-- 1.4 缺失信息维护 | ||
148 | + | ||
149 | +-- 网销信息缺失类型的全量枚举表(无需同步) | ||
150 | +-- DROP TABLE IF EXISTS `netsale_infomiss`; | ||
151 | + CREATE TABLE erp_product.netsale_infomiss ( | ||
152 | + `id` int(11) unsigned NOT NULL AUTO_INCREMENT, | ||
153 | + `name` varchar(100) DEFAULT NULL, | ||
154 | + PRIMARY KEY (`id`) | ||
155 | + ) ENGINE=INNODB DEFAULT CHARSET=utf8 COMMENT '网销信息缺失类型的全量枚举表'; | ||
156 | + | ||
157 | + insert into erp_product.netsale_infomiss (name) values('文本信息'),('尺码信息'),('搜索/标签'); | ||
158 | + | ||
159 | +-- 商品和网销信息缺失表的关联关系表(无需同步) | ||
160 | +-- DROP TABLE IF EXISTS `netsale_infomiss_relation`; | ||
161 | + CREATE TABLE erp_product.netsale_infomiss_relation ( | ||
162 | + `product_skn` int(11) unsigned NOT NULL, | ||
163 | + `infomiss_id` int(11) unsigned NOT NULL COMMENT 'netsale_infomiss_sort 的主键', | ||
164 | + PRIMARY KEY (`product_skn`, infomiss_id) | ||
165 | + ) ENGINE=INNODB DEFAULT CHARSET=utf8 COMMENT '网销信息缺失类型和商品的关系表'; | ||
166 | + | ||
167 | +-- erp_product | ||
168 | +-- 产品参数 | ||
169 | +CREATE TABLE erp_product.product_attribute ( | ||
170 | + `attribute_id` int(11) unsigned NOT NULL AUTO_INCREMENT, | ||
171 | + `attribute_name` varchar(100) DEFAULT NULL, | ||
172 | + `category_id` int(11) unsigned NOT NULL DEFAULT '0', | ||
173 | + `sale_type` int(11) unsigned DEFAULT '0' COMMENT '1:销售属性 2:非销售属性 3:扩展属性', | ||
174 | + `input_type` enum('radio','checkbox','select','text','textarea') DEFAULT NULL COMMENT 'radio 单选\n checkbox 复选\n select 下拉列表\n text 输入框\n textarea 多行输入', | ||
175 | + `attribute_type` tinyint(3) unsigned DEFAULT NULL COMMENT '1 - 可销售属性\n 2 - 非可销售属性\n 3 - 扩展属性', | ||
176 | + `is_must` enum('Y','N') DEFAULT 'N', | ||
177 | + `is_search` enum('Y','N') DEFAULT 'Y', | ||
178 | + `max_value_len` smallint(5) unsigned DEFAULT '50', | ||
179 | + `is_color` enum('Y','N') DEFAULT 'N', | ||
180 | + `is_allow_alias` enum('Y','N') DEFAULT 'N', | ||
181 | + `order_by` int(11) unsigned DEFAULT '0', | ||
182 | + `state` tinyint(3) unsigned DEFAULT '1', | ||
183 | + `remark` varchar(500) DEFAULT NULL, | ||
184 | + `attribute_values` varchar(1000) DEFAULT NULL COMMENT '红色,白色,黑色', | ||
185 | + `belong` tinyint(3) unsigned DEFAULT '10' COMMENT '10系统\n 20商家', | ||
186 | + `create_time` int(10) unsigned DEFAULT NULL, | ||
187 | + `display_position` int(1) unsigned DEFAULT '1' COMMENT '1:基础商品-非销售属性 2:网销信息-上架后补全信息 3:网销信息-商品参数', | ||
188 | + PRIMARY KEY (`attribute_id`) | ||
189 | +) ENGINE=InnoDB AUTO_INCREMENT=72 DEFAULT CHARSET=utf8; | ||
190 | + | ||
191 | + | ||
192 | +INSERT INTO erp_product.product_attribute(attribute_id,`attribute_name`,`category_id`,`input_type`,`sale_type`,`attribute_values`,`display_position`)VALUES(2001,'弹性',0,'select',2,'[{\"id\":1,\"name\":\"1\"},{\"id\":2,\"name\":\"2\"},{\"id\":3,\"name\":\"3\"},{\"id\":4,\"name\":\"4\"},{\"id\":5,\"name\":\"5\"}]', 2); | ||
193 | +INSERT INTO erp_product.product_attribute(attribute_id,`attribute_name`,`category_id`,`input_type`,`sale_type`,`attribute_values`,`display_position`)VALUES(2002,'厚度',0,'select',2,'[{\"id\":1,\"name\":\"1\"},{\"id\":2,\"name\":\"2\"},{\"id\":3,\"name\":\"3\"},{\"id\":4,\"name\":\"4\"},{\"id\":5,\"name\":\"5\"}]', 2); | ||
194 | +INSERT INTO erp_product.product_attribute(attribute_id,`attribute_name`,`category_id`,`input_type`,`sale_type`,`attribute_values`,`display_position`)VALUES(2003,'柔软度',0,'select',2,'[{\"id\":1,\"name\":\"1\"},{\"id\":2,\"name\":\"2\"},{\"id\":3,\"name\":\"3\"},{\"id\":4,\"name\":\"4\"},{\"id\":5,\"name\":\"5\"}]', 2); | ||
195 | +INSERT INTO erp_product.product_attribute(attribute_id,`attribute_name`,`category_id`,`input_type`,`sale_type`,`attribute_values`,`display_position`)VALUES(2004,'透气性',0,'select',2,'[{\"id\":1,\"name\":\"1\"},{\"id\":2,\"name\":\"2\"},{\"id\":3,\"name\":\"3\"},{\"id\":4,\"name\":\"4\"},{\"id\":5,\"name\":\"5\"}]', 2); | ||
196 | +INSERT INTO erp_product.product_attribute(attribute_id,`attribute_name`,`category_id`, `input_type`,`sale_type`,`attribute_values`,`display_position`)VALUES(2005,'洗涤提示',0,'checkbox',2,'[{\"id\":1,\"name\":\"不可熨烫\"},{\"id\":2,\"name\":\"不可转笼翻转干燥\"},{\"id\":3,\"name\":\"30度水温弱速洗\"},{\"id\":4,\"name\":\"不可氯漂\"},{\"id\":5,\"name\":\"不可干洗\"},{\"id\":6,\"name\":\"不可拧干\"},{\"id\":7,\"name\":\"分色洗涤\"}]', 3); | ||
197 | + | ||
198 | + | ||
199 | + | ||
200 | + | ||
201 | + | ||
202 | + | ||
203 | + | ||
204 | + | ||
205 | + | ||
206 | + | ||
207 | + | ||
208 | + | ||
209 | + | ||
210 | + | ||
211 | + | ||
212 | +-- 2 yh_shops 库 | ||
213 | +-- 2.1 商品的展示店铺 | ||
214 | +create table yh_shops.product_shop_relation( | ||
215 | + product_skn int COMMENT 'SKN', | ||
216 | + shop_id int COMMENT '店铺Id' | ||
217 | +); | ||
218 | +Alter table yh_shops.product_shop_relation add primary key(product_skn, shop_id); | ||
219 | + | ||
220 | +-- 标识商品是否是新平台的商品 | ||
221 | +alter table yh_shops.product add column source_flag enum('0', '1') default '0' COMMENT '新平台发布的商品为1 原来则为0'; | ||
222 | + | ||
223 | + | ||
224 | + | ||
225 | + | ||
226 | + | ||
227 | + | ||
228 | + | ||
229 | +-- 2.5 预上架上新记录表 | ||
230 | + Alter table yh_shops.product_timing ADD column `product_skn` int(11) unsigned default 0; | ||
231 | + Alter table yh_shops.product_timing ADD column `advance_begin_time` int(10) unsigned; -- 预售开始时间 | ||
232 | + Alter table yh_shops.product_timing ADD column `advance_end_time` int(10) unsigned; -- 预售结束时间 | ||
233 | + Alter table yh_shops.product_timing ADD column `on_new_time` int(10) unsigned; -- 预上架上新时间 | ||
234 | + Alter table yh_shops.product_timing ADD column `out_sale_time` int(10) unsigned; -- 售罄后几天下架时间 | ||
235 | + create index timing_skn on yh_shops.product_timing(`product_skn`); | ||
236 | + Alter table yh_shops.product_timing modify column shelve_time int(10) unsigned COMMENT '预上架架时间'; | ||
237 | + | ||
238 | + | ||
239 | + | ||
240 | + | ||
241 | +-- 2.8 平台商品属性值表 | ||
242 | + | ||
243 | + CREATE TABLE yh_shops.product_attribute_property_values ( | ||
244 | + `id` int(11) unsigned NOT NULL AUTO_INCREMENT, | ||
245 | + `product_skn` int(11) unsigned NOT NULL, | ||
246 | + `attribute_id` int(11) unsigned NOT NULL COMMENT '品类属性ID', | ||
247 | + `attribute_value_id` int(11) unsigned NOT NULL COMMENT '品类属性值ID', | ||
248 | + `display_position` int(1) unsigned DEFAULT '1' COMMENT '1:基础商品-非销售属性 2:网销信息-上架后补全信息 3:网销信息-商品参数', | ||
249 | + PRIMARY KEY (`id`), | ||
250 | + KEY `attribute_pro_skn_attrid` (`product_skn`,`attribute_id`) | ||
251 | + ) ENGINE=INNODB DEFAULT CHARSET=utf8 COMMENT '平台商品属性值表'; | ||
252 | + | ||
253 | + | ||
254 | + | ||
255 | + | ||
256 | +-- yh_shops | ||
257 | +ALTER TABLE yh_shops.product_standard_relation ADD COLUMN product_skn INT(11) UNSIGNED; | ||
258 | + | ||
259 | +ALTER TABLE yh_shops.`product_collocation` ADD COLUMN product_skn INT(11) UNSIGNED ; | ||
260 | + | ||
261 | +-- brand_folder | ||
262 | +ALTER TABLE yh_shops.brand_folder ADD shops_id INT(11) UNSIGNED COMMENT '店铺id'; | ||
263 | +ALTER TABLE yh_shops.brand_folder ADD `create_time` int(10) unsigned DEFAULT '0' COMMENT '创建时间'; | ||
264 | +ALTER TABLE yh_shops.brand_folder ADD `update_time` int(10) unsigned DEFAULT '0' COMMENT '修改时间'; | ||
265 | +ALTER TABLE yh_shops.brand_folder CHANGE parent_id parent_id INT(11) UNSIGNED null ; | ||
266 | +ALTER TABLE yh_shops.brand_folder CHANGE order_by order_by SMALLINT(6) null; | ||
267 | +-- brand_series | ||
268 | +ALTER TABLE yh_shops.`brand_series` ADD shops_id INT(11) UNSIGNED COMMENT '店铺id'; | ||
269 | +ALTER TABLE yh_shops.`brand_series` ADD `create_time` int(10) unsigned DEFAULT '0' COMMENT '创建时间'; | ||
270 | +ALTER TABLE yh_shops.`brand_series` ADD `update_time` int(10) unsigned DEFAULT '0' COMMENT '修改时间'; | ||
271 | + -- add key | ||
272 | +ALTER TABLE yh_shops.`brand_series` ADD KEY key_shops_id (shops_id); | ||
273 | +ALTER TABLE yh_shops.`brand_series` ADD KEY key_brand_id (brand_id); | ||
274 | +-- set null | ||
275 | +ALTER TABLE yh_shops.brand_series CHANGE parent_id parent_id INT(11) UNSIGNED null ; | ||
276 | +ALTER TABLE yh_shops.brand_series CHANGE order_by order_by SMALLINT(6) null; | ||
277 | + | ||
278 | + | ||
279 | +ALTER TABLE `yh_shops`.`product` | ||
280 | +ADD COLUMN `limit_start_time` int(10) UNSIGNED DEFAULT 0 COMMENT '限购开始时间', | ||
281 | +ADD COLUMN `limit_end_time` int(10) UNSIGNED DEFAULT 0 COMMENT '限购结束时间' AFTER `limit_start_time`, | ||
282 | +ADD COLUMN `expect_shelf_time` int(10) UNSIGNED DEFAULT 0 COMMENT '预计上架时间' AFTER `limit_end_time`, | ||
283 | +ADD COLUMN `product_code` varchar(100) DEFAULT '' COMMENT '厂家编号' AFTER `expect_shelf_time`, | ||
284 | +ADD COLUMN `age_level` varchar(50) DEFAULT '' COMMENT '年龄层(1成人 2大童 3小童 逗号分隔)' AFTER `product_code`, | ||
285 | +ADD COLUMN `goods_years` smallint(5) DEFAULT '0' COMMENT '货品年', | ||
286 | +ADD COLUMN `goods_season` smallint(5) DEFAULT '0' COMMENT '货品季', | ||
287 | +MODIFY COLUMN `is_outlets` enum('Y','N') DEFAULT 'N' COMMENT '是否奥莱 Y:是N:否', | ||
288 | +ADD COLUMN `outlets_setting` enum('B','N','S') DEFAULT 'N' COMMENT '奥特莱斯设置B:品牌设置;S:店铺设置,N:不设置', | ||
289 | +ADD COLUMN `is_promotional_gifts` enum('Y','N') DEFAULT 'N' AFTER `goods_season`; | ||
290 | +ALTER TABLE yh_shops.product | ||
291 | +MODIFY COLUMN `is_outlets` enum('Y','B','N') CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT 'N' COMMENT '是否奥莱 Y:是N:否' AFTER `storage`; | ||
292 | + | ||
293 | +ALTER TABLE yh_shops.product | ||
294 | +ADD COLUMN `series` varchar(100) NULL DEFAULT NULL AFTER `outlets_setting`, | ||
295 | +ADD COLUMN `models` varchar(100) NULL DEFAULT NULL AFTER `series`, | ||
296 | +ADD COLUMN `product_tag` varchar(100) NULL DEFAULT NULL AFTER `models`, | ||
297 | +ADD COLUMN `product_elements` varchar(200) NULL DEFAULT NULL AFTER `product_tag`, | ||
298 | +ADD COLUMN `product_style` varchar(200) NULL AFTER `product_elements`, | ||
299 | +ADD COLUMN `grade` char(20) NULL DEFAULT NULL COMMENT '重点款型(是:K,否:null)' AFTER `product_style`, | ||
300 | +ADD COLUMN `brand_folder` int(5) NULL DEFAULT NULL AFTER `grad; | ||
301 | + | ||
302 | + | ||
303 | +ALTER TABLE yh_shops.storage | ||
304 | +ADD COLUMN `factory_code` varchar(100) NULL AFTER `create_time`, | ||
305 | +ADD COLUMN `is_suppled` enum('N','Y') NOT NULL DEFAULT 'Y' COMMENT '能否补货' AFTER `factory_code`, | ||
306 | +ADD COLUMN `product_skc` int(11) NOT NULL DEFAULT 0 AFTER `is_suppled`; | ||
307 | +--------------------- | ||
308 | +ALTER TABLE yh_shops.goods | ||
309 | +ADD COLUMN `factory_code` varchar(100) NULL; | ||
310 | +-------------------------- | ||
311 | + CREATE TABLE `product_ext` ( | ||
312 | + `product_skn` int(11) NOT NULL DEFAULT '0' COMMENT '商品erp标识', | ||
313 | + `product_desc` text COMMENT '描述', | ||
314 | + `recommend` text COMMENT '小编推荐', | ||
315 | + `is_hostsell` enum('Y','N') DEFAULT 'N' COMMENT '是否热销 Y:是N:否', | ||
316 | + `shelves_day` int(11) DEFAULT NULL COMMENT '售罄后几天后下架', | ||
317 | + `search_keys` varchar(500) DEFAULT NULL COMMENT '搜索关键词 以英文逗号分隔', | ||
318 | + `vedio_url` varchar(100) DEFAULT NULL COMMENT '视频链接', | ||
319 | + `make_crafts` varchar(50) DEFAULT NULL COMMENT '制作工艺', | ||
320 | + `brand_series` varchar(50) DEFAULT NULL COMMENT '品牌系列', | ||
321 | + `brand_model` varchar(50) DEFAULT NULL COMMENT '品牌款型', | ||
322 | + `reject_reason` varchar(500) DEFAULT NULL COMMENT '驳回原因', | ||
323 | + PRIMARY KEY (`product_skn`) | ||
324 | +) ENGINE=MyISAM DEFAULT CHARSET=utf8; |
-
Please register or login to post a comment