...
|
...
|
@@ -41,7 +41,7 @@ ADD COLUMN `factory_goods_name` varchar(50) COMMENT '厂家颜色' AFTER `goods_ |
|
|
|
|
|
ALTER TABLE `erp_supplier`.`base_single`
|
|
|
ADD COLUMN `is_suppled` enum('N','Y') DEFAULT 'Y' COMMENT '能否补货' AFTER `size_id`,
|
|
|
ADD COLUMN `presale_storage_num` int(11) unsigned DEFAULT '0' COMMENT '预售库存' AFTER `bar_code`,
|
|
|
ADD COLUMN `presale_storage_num` int(11) unsigned DEFAULT '0' COMMENT '预售库存',
|
|
|
ADD INDEX `is_suppled` (`is_suppled`) comment '';
|
|
|
|
|
|
|
...
|
...
|
@@ -101,9 +101,6 @@ ADD COLUMN `presale_storage_num` int(11) unsigned DEFAULT '0' COMMENT '预售库 |
|
|
ADD INDEX `is_suppled` (`is_suppled`) comment '';
|
|
|
|
|
|
|
|
|
ALTER TABLE `erp_product`.`storage`
|
|
|
DROP COLUMN `presale_storage_num`;
|
|
|
|
|
|
|
|
|
--4、product_price:
|
|
|
|
...
|
...
|
@@ -121,9 +118,9 @@ alter table erp_product.product add column `stock` smallint(6) DEFAULT 0 COMMEN |
|
|
alter table erp_product.product add column `next_status` smallint COMMENT '下一流程状态';
|
|
|
Alter table erp_product.product ADD column `founder` int(11) COMMENT '操作人';
|
|
|
Alter table erp_product.product ADD column `is_info_miss` enum('Y', 'N') default 'Y' COMMENT '是否信息缺失';
|
|
|
create index product_edittime on product(`edit_time`);
|
|
|
create index product_edittime on erp_product.product(`edit_time`);
|
|
|
|
|
|
create table product_ext(
|
|
|
create table erp_product.product_ext(
|
|
|
product_skn int COMMENT '商品erp标识',
|
|
|
product_desc text COMMENT '描述', -- 废弃
|
|
|
recommend text COMMENT '小编推荐', -- 新增字段
|
...
|
...
|
@@ -140,7 +137,7 @@ create table product_ext( |
|
|
brand_model varchar(50) COMMENT '品牌款型', -- 新增字段
|
|
|
reject_reason varchar(500) COMMENT '驳回原因' -- 无需同步
|
|
|
)ENGINE=INNODB DEFAULT CHARSET=utf8;
|
|
|
Alter table product_ext add primary key(product_skn);
|
|
|
Alter table erp_product.product_ext add primary key(product_skn);
|
|
|
|
|
|
-- 变价表和变价日志表
|
|
|
alter table erp_product.product_price modify `founder` int(11) unsigned DEFAULT '0' COMMENT '操作人ID';
|
...
|
...
|
@@ -151,17 +148,17 @@ alter table erp_product.product_price_log modify `founder` int(11) unsigned DEF |
|
|
|
|
|
-- 网销信息缺失类型的全量枚举表(无需同步)
|
|
|
-- DROP TABLE IF EXISTS `netsale_infomiss`;
|
|
|
CREATE TABLE netsale_infomiss (
|
|
|
CREATE TABLE erp_product.netsale_infomiss (
|
|
|
`id` int(11) unsigned NOT NULL AUTO_INCREMENT,
|
|
|
`name` varchar(100) DEFAULT NULL,
|
|
|
PRIMARY KEY (`id`)
|
|
|
) ENGINE=INNODB DEFAULT CHARSET=utf8 COMMENT '网销信息缺失类型的全量枚举表';
|
|
|
|
|
|
insert into netsale_infomiss (name) values('文本信息'),('尺码信息'),('搜索/标签');
|
|
|
insert into erp_product.netsale_infomiss (name) values('文本信息'),('尺码信息'),('搜索/标签');
|
|
|
|
|
|
-- 商品和网销信息缺失表的关联关系表(无需同步)
|
|
|
-- DROP TABLE IF EXISTS `netsale_infomiss_relation`;
|
|
|
CREATE TABLE netsale_infomiss_relation (
|
|
|
CREATE TABLE erp_product.netsale_infomiss_relation (
|
|
|
`product_skn` int(11) unsigned NOT NULL,
|
|
|
`infomiss_id` int(11) unsigned NOT NULL COMMENT 'netsale_infomiss_sort 的主键',
|
|
|
PRIMARY KEY (`product_skn`, infomiss_id)
|
...
|
...
|
@@ -169,7 +166,7 @@ alter table erp_product.product_price_log modify `founder` int(11) unsigned DEF |
|
|
|
|
|
-- erp_product
|
|
|
-- 产品参数
|
|
|
CREATE TABLE `product_attribute` (
|
|
|
CREATE TABLE erp_product.product_attribute (
|
|
|
`attribute_id` int(11) unsigned NOT NULL AUTO_INCREMENT,
|
|
|
`attribute_name` varchar(100) DEFAULT NULL,
|
|
|
`category_id` int(11) unsigned NOT NULL DEFAULT '0',
|
...
|
...
|
@@ -192,11 +189,11 @@ CREATE TABLE `product_attribute` ( |
|
|
) ENGINE=InnoDB AUTO_INCREMENT=72 DEFAULT CHARSET=utf8;
|
|
|
|
|
|
|
|
|
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);
|
|
|
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);
|
|
|
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);
|
|
|
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);
|
|
|
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);
|
|
|
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);
|
|
|
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);
|
|
|
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);
|
|
|
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);
|
|
|
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);
|
|
|
|
|
|
|
|
|
|
...
|
...
|
@@ -214,11 +211,11 @@ INSERT INTO `product_attribute`(attribute_id,`attribute_name`,`category_id`, `in |
|
|
|
|
|
-- 2 yh_shops 库
|
|
|
-- 2.1 商品的展示店铺
|
|
|
create table product_shop_relation(
|
|
|
create table yh_shops.product_shop_relation(
|
|
|
product_skn int COMMENT 'SKN',
|
|
|
shop_id int COMMENT '店铺Id'
|
|
|
);
|
|
|
Alter table product_shop_relation add primary key(product_skn, shop_id);
|
|
|
Alter table yh_shops.product_shop_relation add primary key(product_skn, shop_id);
|
|
|
|
|
|
-- 标识商品是否是新平台的商品
|
|
|
alter table yh_shops.product add column source_flag enum('0', '1') default '0' COMMENT '新平台发布的商品为1 原来则为0';
|
...
|
...
|
@@ -230,20 +227,20 @@ alter table yh_shops.product add column source_flag enum('0', '1') default '0' |
|
|
|
|
|
|
|
|
-- 2.5 预上架上新记录表
|
|
|
Alter table product_timing ADD column `product_skn` int(11) unsigned default 0;
|
|
|
Alter table product_timing ADD column `advance_begin_time` int(10) unsigned; -- 预售开始时间
|
|
|
Alter table product_timing ADD column `advance_end_time` int(10) unsigned; -- 预售结束时间
|
|
|
Alter table product_timing ADD column `on_new_time` int(10) unsigned; -- 预上架上新时间
|
|
|
Alter table product_timing ADD column `out_sale_time` int(10) unsigned; -- 售罄后几天下架时间
|
|
|
create index timing_skn on product_timing(`product_skn`);
|
|
|
Alter table product_timing modify column shelve_time int(10) unsigned COMMENT '预上架架时间';
|
|
|
Alter table yh_shops.product_timing ADD column `product_skn` int(11) unsigned default 0;
|
|
|
Alter table yh_shops.product_timing ADD column `advance_begin_time` int(10) unsigned; -- 预售开始时间
|
|
|
Alter table yh_shops.product_timing ADD column `advance_end_time` int(10) unsigned; -- 预售结束时间
|
|
|
Alter table yh_shops.product_timing ADD column `on_new_time` int(10) unsigned; -- 预上架上新时间
|
|
|
Alter table yh_shops.product_timing ADD column `out_sale_time` int(10) unsigned; -- 售罄后几天下架时间
|
|
|
create index timing_skn on yh_shops.product_timing(`product_skn`);
|
|
|
Alter table yh_shops.product_timing modify column shelve_time int(10) unsigned COMMENT '预上架架时间';
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
-- 2.8 平台商品属性值表
|
|
|
|
|
|
CREATE TABLE product_attribute_property_values (
|
|
|
CREATE TABLE yh_shops.product_attribute_property_values (
|
|
|
`id` int(11) unsigned NOT NULL AUTO_INCREMENT,
|
|
|
`product_skn` int(11) unsigned NOT NULL,
|
|
|
`attribute_id` int(11) unsigned NOT NULL COMMENT '品类属性ID',
|
...
|
...
|
@@ -290,10 +287,10 @@ ADD COLUMN `goods_season` smallint(5) DEFAULT '0' COMMENT '货品季', |
|
|
MODIFY COLUMN `is_outlets` enum('Y','N') DEFAULT 'N' COMMENT '是否奥莱 Y:是N:否',
|
|
|
ADD COLUMN `outlets_setting` enum('B','N','S') DEFAULT 'N' COMMENT '奥特莱斯设置B:品牌设置;S:店铺设置,N:不设置',
|
|
|
ADD COLUMN `is_promotional_gifts` enum('Y','N') DEFAULT 'N' AFTER `goods_season`;
|
|
|
ALTER TABLE `product`
|
|
|
ALTER TABLE yh_shops.product
|
|
|
MODIFY COLUMN `is_outlets` enum('Y','B','N') CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT 'N' COMMENT '是否奥莱 Y:是N:否' AFTER `storage`;
|
|
|
|
|
|
ALTER TABLE `product`
|
|
|
ALTER TABLE yh_shops.product
|
|
|
ADD COLUMN `series` varchar(100) NULL DEFAULT NULL AFTER `outlets_setting`,
|
|
|
ADD COLUMN `models` varchar(100) NULL DEFAULT NULL AFTER `series`,
|
|
|
ADD COLUMN `product_tag` varchar(100) NULL DEFAULT NULL AFTER `models`,
|
...
|
...
|
@@ -303,12 +300,12 @@ ADD COLUMN `grade` char(20) NULL DEFAULT NULL COMMENT '重点款型(是:K, |
|
|
ADD COLUMN `brand_folder` int(5) NULL DEFAULT NULL AFTER `grad;
|
|
|
|
|
|
|
|
|
ALTER TABLE `storage`
|
|
|
ALTER TABLE yh_shops.storage
|
|
|
ADD COLUMN `factory_code` varchar(100) NULL AFTER `create_time`,
|
|
|
ADD COLUMN `is_suppled` enum('N','Y') NOT NULL DEFAULT 'Y' COMMENT '能否补货' AFTER `factory_code`,
|
|
|
ADD COLUMN `product_skc` int(11) NOT NULL DEFAULT 0 AFTER `is_suppled`;
|
|
|
---------------------
|
|
|
ALTER TABLE `goods`
|
|
|
ALTER TABLE yh_shops.goods
|
|
|
ADD COLUMN `factory_code` varchar(100) NULL;
|
|
|
--------------------------
|
|
|
CREATE TABLE `product_ext` (
|
...
|
...
|
|