/**
Source Server Version: 8.0.31
Source Database: backendsys
Date: 2023/12/16 16:26:13
*/

DROP TABLE IF EXISTS `b2c_shopping_cart`;

CREATE TABLE `b2c_shopping_cart` (
    PRIMARY KEY (`id`),
    `id` BIGINT AUTO_INCREMENT,
    `member_id` BIGINT NOT NULL COMMENT '会员ID',
    `good_id` BIGINT NOT NULL COMMENT '商品ID',
    `sku_id` BIGINT NOT NULL COMMENT '规格ID',
    `quantity` INT NOT NULL COMMENT '数量',
    `source` VARCHAR(20) COMMENT '来源 (MiniProgram, H5, APP)',
    `create_time` DATETIME DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
    `update_time` DATETIME DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间'
) ENGINE=INNODB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8mb4 COMMENT='购物车表';

INSERT INTO b2c_shopping_cart(member_id, good_id, sku_id, quantity, source) VALUES
    (1, 1, 1, 2, 'MiniProgram'),
    (1, 1, 1, 1, 'H5'),
    (1, 1, 1, 5, 'APP')
;
