base_product.sql 5.91 KB
erp_supplier库:
1base_product
ALTER TABLE `erp_supplier`.`base_product`
CHANGE COLUMN `grade` `grade` char(20) DEFAULT NULL COMMENT '重点款型(是:1,否:null)',
ADD COLUMN `factory_code` varchar(100) DEFAULT '' COMMENT '厂家编号' AFTER `brand_folder`,
ADD COLUMN `age_level` varchar(50) DEFAULT '' COMMENT '年龄层(1成人 2大童 3小童 逗号分隔)' AFTER `factory_code`,
MODIFY COLUMN `goods_season`  smallint(5) NULL DEFAULT 0 COMMENT '1:春2:夏3:秋4:冬5:春夏6:秋冬' AFTER `goods_years`,
ADD COLUMN `is_vip` enum('Y','N','B') NULL DEFAULT 'B' COMMENT '是否VIP Y:是N:否B:品牌设置' AFTER `age_level`,
ADD COLUMN `is_limitbuy`  enum('Y','N') NULL DEFAULT 'N' COMMENT '是否限购' AFTER `is_vip`,
ADD COLUMN `limit_start_time`  int(10) UNSIGNED NULL DEFAULT 0 COMMENT '限购开始时间' AFTER `is_limitbuy`,
ADD COLUMN `limit_end_time`  int(10) NULL DEFAULT 0 COMMENT '限购结束时间' AFTER `limit_start_time`,
ADD COLUMN `expect_shelf_time`  int(10) NULL DEFAULT 0 COMMENT '预计上架时间' AFTER `limit_end_time`,
ADD COLUMN `is_outlets`  enum('Y','N','B') NULL DEFAULT 'B' COMMENT '是否奥莱 Y:是N:否B:品牌设置' AFTER `expect_shelf_time`,
ADD COLUMN `seasons`  varchar(100)  DEFAULT '' COMMENT '适销季 夏:summer 冬:winter 四季:seasons',
ADD COLUMN `reason`  varchar(255)  DEFAULT '' COMMENT '审批驳回原因',
ADD COLUMN `editId` int(10) COMMENT '修改人id',
ADD COLUMN `audit_pass_id` int(10) COMMENT '审核通过人id',
ADD COLUMN `audit_pass_time`  int(10) NULL DEFAULT 0 COMMENT '审核通过时间',
ADD COLUMN `audit_fail_id` int(10) COMMENT '审核不通过人id',
ADD COLUMN `audit_fail_time`  int(10) NULL DEFAULT 0 COMMENT '审核不通过时间',
ADD COLUMN `operate_info`  varchar(255)  DEFAULT '' COMMENT '操作信息';


/**建立索引***/
ALTER TABLE `erp_supplier`.`base_product`
ADD INDEX `brand_id` (`brand_id`) comment '',
ADD INDEX `shop_id` (`shop_id`) comment '',
ADD INDEX `supplier_id` (`supplier_id`) comment '',
ADD INDEX `is_auditing` (`is_auditing`) comment '',
ADD INDEX `attribute` (`attribute`) comment '',
ADD INDEX `is_jit` (`is_jit`) comment '',
ADD INDEX `is_advance` (`is_advance`) comment '',
ADD INDEX `is_outlets` (`is_outlets`) comment '';

2base_goods:
ALTER TABLE `erp_supplier`.`base_goods` 
ADD COLUMN `model_code` varchar(50) COMMENT '款型编号' AFTER `color_id`,
ADD COLUMN `factory_goods_name` varchar(50) COMMENT '厂家颜色' AFTER `goods_name`;


3base_single

ALTER TABLE `erp_supplier`.`base_single` 
ADD COLUMN `is_suppled` enum('N','Y') DEFAULT 'Y' COMMENT '能否补货' AFTER `size_id`,
ADD COLUMN `bar_code` varchar(255)  DEFAULT '' COMMENT '条形码' AFTER `is_suppled`,
ADD COLUMN `presale_storage_num` int(11) unsigned DEFAULT '0' COMMENT '预售库存' AFTER `bar_code`,
ADD INDEX `is_suppled` (`is_suppled`) comment '';


erp_product库:
1product:

ALTER TABLE `erp_product`.`product`
ADD COLUMN `goods_years`  smallint(5)  DEFAULT 0,
ADD COLUMN `goods_season`  smallint(5) DEFAULT 0 COMMENT '1:春2:夏3:秋4:冬5:春夏6:秋冬' AFTER `goods_years`,
ADD COLUMN `limit_start_time` int(10) UNSIGNED DEFAULT 0 COMMENT '限购开始时间' AFTER `brand_folder`,
ADD COLUMN `limit_end_time` int(10) UNSIGNED DEFAULT 0 COMMENT '限购结束时间' AFTER `limit_start_time`,
ADD COLUMN `expect_shelf_time` int(10) UNSIGNED DEFAULT 0 COMMENT '预计上架时间' AFTER `limit_end_time`,
ADD COLUMN `factory_code` varchar(100) DEFAULT '' COMMENT '厂家编号' AFTER `expect_shelf_time`,
ADD COLUMN `age_level` varchar(50) DEFAULT '1' COMMENT '年龄层(1成人 2大童 3小童 逗号分隔)' AFTER `factory_code`,
CHANGE COLUMN `grade` `grade` char(20) DEFAULT NULL COMMENT '重点款型(是:K,否:null)',
MODIFY COLUMN `is_outlets`  enum('Y','N','B')  DEFAULT 'B' COMMENT '是否奥莱 Y:是N:否B:品牌设置' AFTER `is_promotion`,
ADD COLUMN `is_promotional_gifts`  enum('Y','N')  DEFAULT 'N' AFTER `goods_season`,
ADD COLUMN `is_vip` enum('Y','N','B') DEFAULT 'B' COMMENT '是否VIP Y:是N:否B:品牌设置' AFTER `is_promotional_gifts`,
ADD COLUMN `is_limitbuy` enum('Y','N') DEFAULT 'N' COMMENT '是否限购' AFTER `is_vip`,
ADD COLUMN `audit_pass_id` int(10) COMMENT '审核通过人id',
ADD COLUMN `audit_pass_time`  int(10) NULL DEFAULT 0 COMMENT '审核通过时间',
ADD COLUMN `audit_fail_id` int(10) COMMENT '审核不通过人id',
ADD COLUMN `audit_fail_time`  int(10) NULL DEFAULT 0 COMMENT '审核不通过时间',
ADD COLUMN `operate_info`  varchar(255)  DEFAULT '' COMMENT '操作信息';


/***添加索引****/
ALTER TABLE `erp_product`.`product`
ADD INDEX `brand_id` (`brand_id`) comment '',
ADD INDEX `shop_id` (`shop_id`) comment '',
ADD INDEX `supplier_id` (`supplier_id`) comment '',
ADD INDEX `attribute` (`attribute`) comment '',
ADD INDEX `is_jit` (`is_jit`) comment '',
ADD INDEX `is_outlets` (`is_outlets`) comment '',
ADD INDEX `is_advance` (`is_advance`) comment '';

2goods:
ALTER TABLE `erp_product`.`goods` 
ADD COLUMN `model_code` varchar(50) COMMENT '款型编号' AFTER `color_id`,
ADD COLUMN `factory_goods_name` varchar(50) COMMENT '厂家颜色' AFTER `goods_name`;

3storage

ALTER TABLE `erp_product`.`storage` 
ADD COLUMN `is_suppled` enum('Y','N') DEFAULT 'Y' COMMENT '能否补货' AFTER `update_time`, 
ADD COLUMN `bar_code` varchar(255)  DEFAULT '' COMMENT '条形码' AFTER `is_suppled`,
ADD COLUMN `presale_storage_num` int(11) unsigned DEFAULT '0' COMMENT '预售库存' AFTER `bar_code`,
ADD INDEX `is_suppled` (`is_suppled`) comment '';


ALTER TABLE `erp_product`.`storage` 
DROP COLUMN `presale_storage_num`;


4product_price:

ALTER TABLE `erp_product`.`product_price`
CHANGE COLUMN `founder` `founder` int(11) UNSIGNED DEFAULT 0 COMMENT '操作人ID',
ADD COLUMN `enable_vip` tinyint(3) UNSIGNED DEFAULT 2 COMMENT '是否享受vip折扣:1 根据品牌设置进行折扣 2 开启 3 关闭' AFTER `founder`;