alter table shop_product_image add `product_name` varchar(100) DEFAULT '' COMMENT '产品名称同步数据用'; alter table shop_product_image add `product_number` varchar(50) DEFAULT '' COMMENT '商品货号同步数据用'; alter table shop_product_image add `product_short_name` varchar(100) DEFAULT '' COMMENT '商品简称,作为匹配关键字'; alter table library_product add `product_short_name` varchar(100) DEFAULT '' COMMENT '商品简称,作为匹配关键字'; alter table shop_product_base add `product_short_name` varchar(100) DEFAULT '' COMMENT '商品简称,作为匹配关键字'; alter table shop_product_image add `product_from` varchar(5) DEFAULT '' COMMENT '商品来源(ENUM):1000-发布;1001-天猫;1002-淘宝;1003-阿里巴巴;1004-京东;1005-思迅;同步数据匹配'; alter table shop_product_image add index `index_sproduct_short_name` (`product_short_name`) USING BTREE; alter table library_product add index `index_product_short_name` (`product_short_name`) USING BTREE; alter table shop_product_base add index `index_product_short_name` (`product_short_name`) USING BTREE; alter table shop_product_image add index `index_product_from` (`product_from`) USING BTREE; CREATE INDEX idx_shop_product_filter ON shop_product_image(product_from, item_image_default) USING BTREE; CREATE TABLE shop_image_mapping_temp ( `id` bigint unsigned NOT NULL AUTO_INCREMENT COMMENT '临时表id', `product_image_id` bigint unsigned DEFAULT NULL COMMENT '商品图片编号', `product_id` bigint unsigned DEFAULT 0 COMMENT '产品编号:product_id-color_id', `product_name` varchar(100) DEFAULT '' COMMENT '产品名称同步数据用', `store_id` int unsigned DEFAULT NULL COMMENT '店铺编号', `merged_image_url` text COMMENT '合并后的图片URL', `name` varchar(255) DEFAULT '' COMMENT '图库商品名', `thumb` varchar(512) DEFAULT '' 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 `index_product_name` (`product_name`) USING BTREE, KEY `index_name` (`name`) USING BTREE, KEY `index_store_id` (`store_id`) USING BTREE ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='商品图片映射临时表';