CREATE TABLE `product_mapping` (
                                   `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '主键ID',
                                   `product_name` varchar(255) NOT NULL COMMENT '商品名称',
                                   `spec_value` decimal(18,4) NOT NULL COMMENT '规格数据',
                                   `spec_unit` varchar(20) NOT NULL COMMENT '规格单位',
                                   `description` text ,
                                   `sort_order` int(11) NOT NULL DEFAULT '0' COMMENT '排序值',
                                   `store_id` int unsigned NOT NULL DEFAULT '0' COMMENT '店铺编号',
                                   `create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
                                   `update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
                                   PRIMARY KEY (`id`),
                                   KEY `idx_product_name` (`product_name`) USING BTREE,
                                   KEY `idx_store_id` (`store_id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='商品映射表';

alter table shop_product_base add column `unit_name` varchar(2) DEFAULT NULL COMMENT '总量单位';
alter table shop_product_base add column `shop_weight` DECIMAL(18,4) NOT NULL COMMENT '总重量'
alter table shop_product_base add column `unit_price` DECIMAL(18,4) NOT NULL COMMENT '单价';

alter table shop_base_product_spec add column `store_id` int unsigned NOT NULL DEFAULT '0' COMMENT '店铺编号';
alter table shop_base_product_spec add index `store_id` (`store_id`) USING BTREE;

INSERT INTO shop_base_product_state
(product_state_id, product_state_name, product_state_text_1, product_state_text_2, product_state_remark)
VALUES(1003, 'PRODUCT_STATE_OFF_THE_SHELF_UNCHECK', '下架未分配商品', '同步数据未分配', '');

alter table store_db_config add column refresh_time datetime DEFAULT NULL COMMENT '刷新时间';
