Showing
1 changed file
with
150 additions
and
0 deletions
1 | +-- 1.数据库(erp_product) | ||
2 | + | ||
3 | +--1.1 产品(erp_product.product) | ||
4 | +alter table erp_product.product add column is_screen enum('Y', 'N') default 'N' COMMENT '是否已拍摄标识'; | ||
5 | +alter table erp_product.product add column is_measure enum('Y', 'N') default 'N' COMMENT '是否已测量标识'; | ||
6 | +alter table erp_product.product add column status smallint default 1 COMMENT ' 8待上架,2待审核,3驳回,4通过,1已上架,0已下架,5再上架待审核,6再上架驳回,7再上架通过'; | ||
7 | +alter table erp_product.product add column first_shelve_time int(10) unsigned DEFAULT '0' COMMENT '首次上架时间'; | ||
8 | +alter table erp_product.product add column shelve_time int(10) unsigned DEFAULT '0' COMMENT '上架时间可作为上新参考'; | ||
9 | +alter table erp_product.product add column `stock` smallint(6) DEFAULT 0 COMMENT '库存'; | ||
10 | +alter table erp_product.product add column `next_status` smallint COMMENT '下一流程状态'; | ||
11 | +create index product_edittime on product(`edit_time`); | ||
12 | + | ||
13 | +create table product_ext( | ||
14 | + product_skn int COMMENT '商品erp标识', | ||
15 | + product_desc text COMMENT '描述', -- 废弃 | ||
16 | + recommend text COMMENT '小编推荐', -- 新增字段 | ||
17 | + is_hostsell enum('Y', 'N') default 'N' COMMENT '是否热销 Y:是N:否', -- 需要割接 之前直接操作的前台表yh_shops.is_hot | ||
18 | + sales_phrase varchar(100) COMMENT '促销短语', -- 需要割接 之前直接操作的前台表yh_shops.sales_phrase | ||
19 | + is_new enum('Y', 'N') default 'N' COMMENT '是否新品 Y:是N:否', -- 需要割接 之前直接操作的前台表yh_shops.is_hot | ||
20 | + shelves_day int COMMENT '售罄后几天后下架', -- 废弃 | ||
21 | + sell_channels set('0','1','2','3','4','5','6','7','8','9') COMMENT '上架渠道', -- 需要割接 之前直接操作的前台表yh_shops.sell_channels | ||
22 | + phrase varchar(500) COMMENT '商品短评', -- 需要割接 之前直接操作的前台表yh_shops.phrase | ||
23 | + search_keys varchar(500) COMMENT '搜索关键词 以英文逗号分隔', -- | ||
24 | + vedio_url varchar(100) COMMENT '视频链接', -- 新增字段 | ||
25 | + make_crafts varchar(50) COMMENT '制作工艺', -- 新增字段 | ||
26 | + brand_series varchar(50) COMMENT '品牌系列', -- 新增字段 | ||
27 | + brand_model varchar(50) COMMENT '品牌款型', -- 新增字段 | ||
28 | + reject_reason varchar(500) COMMENT '驳回原因' -- 无需同步 | ||
29 | +)ENGINE=INNODB DEFAULT CHARSET=utf8; | ||
30 | +Alter table product_ext add primary key(product_skn); | ||
31 | + | ||
32 | +Alter table erp_product.product ADD column `founder` int(11) COMMENT '操作人'; | ||
33 | + | ||
34 | + | ||
35 | +-- 1.2 商品(erp_product.goods) | ||
36 | + | ||
37 | + Alter table erp_product.goods ADD column `status` tinyint(4) NOT NULL DEFAULT '0' COMMENT '0下架 1 上架'; | ||
38 | + -- 需要将yh_shops 的goods状态割接到 erp_product.goods | ||
39 | + | ||
40 | + Alter table erp_product.goods ADD column `factory_goods_name` varchar(50) DEFAULT NULL COMMENT '厂家颜色'; | ||
41 | + | ||
42 | + | ||
43 | + | ||
44 | +-- 1.3 商品库存(erp_product.storage) | ||
45 | + | ||
46 | + Alter table erp_product.storage ADD column `status` tinyint(4) NOT NULL DEFAULT '1' COMMENT '0下架 1 上架'; | ||
47 | + -- 需要将yh_shops 的storage状态割接到 erp_product.storage | ||
48 | + | ||
49 | + | ||
50 | + | ||
51 | +-- 1.4 缺失信息维护 | ||
52 | + | ||
53 | +-- 网销信息缺失类型的全量枚举表(无需同步) | ||
54 | +-- DROP TABLE IF EXISTS `netsale_infomiss`; | ||
55 | + CREATE TABLE netsale_infomiss ( | ||
56 | + `id` int(11) unsigned NOT NULL AUTO_INCREMENT, | ||
57 | + `name` varchar(100) DEFAULT NULL, | ||
58 | + PRIMARY KEY (`id`) | ||
59 | + ) ENGINE=INNODB DEFAULT CHARSET=utf8 COMMENT '网销信息缺失类型的全量枚举表'; | ||
60 | + | ||
61 | + insert into netsale_infomiss (name) values('文本信息'),('尺码信息'),('搜索/标签'); | ||
62 | + | ||
63 | +-- 商品和网销信息缺失表的关联关系表(无需同步) | ||
64 | +-- DROP TABLE IF EXISTS `netsale_infomiss_relation`; | ||
65 | + CREATE TABLE netsale_infomiss_relation ( | ||
66 | + `product_skn` int(11) unsigned NOT NULL, | ||
67 | + `infomiss_id` int(11) unsigned NOT NULL COMMENT 'netsale_infomiss_sort 的主键', | ||
68 | + PRIMARY KEY (`product_skn`, infomiss_id) | ||
69 | + ) ENGINE=INNODB DEFAULT CHARSET=utf8 COMMENT '网销信息缺失类型和商品的关系表'; | ||
70 | + | ||
71 | + | ||
72 | +-- 1.5 商品状态 | ||
73 | + | ||
74 | + | ||
75 | + | ||
76 | + | ||
77 | + | ||
78 | + | ||
79 | + | ||
80 | + | ||
81 | + | ||
82 | + | ||
83 | + | ||
84 | + | ||
85 | + | ||
86 | + | ||
87 | +-- 2 yh_shops 库 | ||
88 | +-- 2.1 商品的展示店铺 | ||
89 | +create table product_shop_relation( | ||
90 | + product_skn int COMMENT 'SKN', | ||
91 | + shop_id int COMMENT '店铺Id' | ||
92 | +); | ||
93 | +Alter table product_shop_relation add primary key(product_skn, shop_id); | ||
94 | + | ||
95 | + | ||
96 | + | ||
97 | +-- 2.2 搭配信息 | ||
98 | + Alter table product_collocation add column `product_skn` int(11) unsigned DEFAULT '0'; | ||
99 | + create index collocation_skn on product_collocation(product_skn); | ||
100 | + | ||
101 | +-- 2.3 商品封面 | ||
102 | + Alter table goods_images add column `product_skc` int(11) unsigned DEFAULT '0'; | ||
103 | + Alter table goods_images add column `product_skn` int(11) unsigned DEFAULT '0'; | ||
104 | + create index goods_img_skn on goods_images(`product_skn`,`is_default`,`status`); | ||
105 | + create index goods_img_skc on goods_images(`product_skc`,`is_default`,`status`); | ||
106 | + create index goods_img_skc_skn on goods_images(`product_skc`,`product_skn`); | ||
107 | + | ||
108 | + | ||
109 | + | ||
110 | +-- 2.4 舒适度等扩展信息 | ||
111 | + Alter table product_special_attr add column `product_skn` int(11) unsigned DEFAULT '0'; | ||
112 | + create index special_attr_skn on product_special_attr(`product_skn`); | ||
113 | + | ||
114 | + | ||
115 | + | ||
116 | +-- 2.5 预上架上新记录表 | ||
117 | + Alter table product_timing ADD column `product_skn` int(11) unsigned default 0; | ||
118 | + Alter table product_timing ADD column `advance_begin_time` int(10) unsigned; -- 预售开始时间 | ||
119 | + Alter table product_timing ADD column `advance_end_time` int(10) unsigned; -- 预售结束时间 | ||
120 | + Alter table product_timing ADD column `on_new_time` int(10) unsigned; -- 预上架上新时间 | ||
121 | + Alter table product_timing ADD column `out_sale_time` int(10) unsigned; -- 售罄后几天下架时间 | ||
122 | + create index timing_skn on product_timing(`product_skn`); | ||
123 | + Alter table product_timing modify column shelve_time int(10) unsigned COMMENT '预上架架时间'; | ||
124 | + | ||
125 | + | ||
126 | + | ||
127 | + | ||
128 | +-- 2.6 商品描述信息 | ||
129 | + Alter table product_intro ADD column `product_skn` int(11) unsigned default 0; | ||
130 | + create index intro_skn on product_intro(`product_skn`); | ||
131 | + | ||
132 | + | ||
133 | +-- 2.7 搜索关键词 | ||
134 | + Alter table product_keywords ADD column `product_skn` int(11) unsigned default 0; | ||
135 | + create index keywords_skn on product_keywords(`product_skn`); | ||
136 | + | ||
137 | + | ||
138 | +-- 3 数据需要特殊割接 | ||
139 | + | ||
140 | +-- 3.1 上架的时候同步插入product_id 数据割接 老数据需要通过product_id 查询product_skn 插入数据库 | ||
141 | +-- product_collocation product_special_attr product_timing | ||
142 | + | ||
143 | + -- product_search product_brand_relation 只需要上架成功,将product_id 填充 | ||
144 | + | ||
145 | + | ||
146 | + | ||
147 | +-- 3.2 上架的时候需要插入 product_id goods_id 数据割接 老数据需要通过product_id 查询product_skn 插入数据库 | ||
148 | +-- goods_images | ||
149 | + | ||
150 | + |
-
Please register or login to post a comment