/**
Source Server Version: 8.0.31
Source Database: backendsys
Date: 2023/08/18 12:51:10
*/

DROP TABLE IF EXISTS `b2c_good`;
CREATE TABLE `b2c_good` (
    PRIMARY KEY (`id`),
    `id` BIGINT AUTO_INCREMENT COMMENT 'ID',
    `uid` VARCHAR(36) NOT NULL UNIQUE COMMENT 'UID',
    `category_id` BIGINT NOT NULL COMMENT '商品分类ID',
    `brand_id` BIGINT COMMENT '商品品牌ID',
    `unit_id` BIGINT COMMENT '商品单位ID',
    `good_thumb` VARCHAR(1000) DEFAULT NULL COMMENT '商品缩略图',
    `good_images` TEXT DEFAULT NULL COMMENT '商品图片 (多图片以逗号间隔)',
    `is_top` TINYINT(1) DEFAULT '-1' COMMENT '是否置顶 (-1否, 1是)',
    `status` TINYINT(1) DEFAULT '-1' COMMENT '商品状态 (-1下架, 1上架)',
    `del_flag` TINYINT(1) DEFAULT '-1' COMMENT '删除标志 (-1未删除, 1删除)',
    `create_time` DATETIME DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
    `update_time` DATETIME DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
    UNIQUE KEY (`uid`),
    INDEX `idx_category_id` (`category_id`),
    INDEX `idx_brand_id` (`brand_id`),
    INDEX `idx_unit_id` (`unit_id`)
) ENGINE=INNODB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8mb4 COMMENT='商品表';

INSERT INTO b2c_good(uid, category_id, brand_id, unit_id, status) VALUES
    ('a1b2c3d4e1', 1, 1, 1, 1),
    ('a1b2c3d4e2', 1, 1, 1, -1),
    ('a1b2c3d4e3', 1, 1, 1, -1),
    ('a1b2c3d4e4', 1, 1, 1, -1),
    ('a1b2c3d4e5', 1, 1, 1, -1),
    ('a1b2c3d4e6', 1, 1, 1, -1),
    ('a1b2c3d4e7', 1, 1, 1, -1),
    ('a1b2c3d4e8', 1, 1, 1, -1),
    ('a1b2c3d4e9', 1, 1, 1, -1),
    ('a1b2c3d4e0', 1, 1, 1, -1),
    ('a1b2c3d410', 1, 1, 1, -1),
    ('a1b2c3d411', 1, 1, 1, -1)
;
