-- 会员购物车
CREATE TABLE IF NOT EXISTS `biz_member_cart_item` (
  `cart_item_id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '购物车行ID',
  `member_id` bigint(20) NOT NULL COMMENT '会员ID',
  `shop_id` bigint(20) NOT NULL COMMENT '店铺ID',
  `goods_id` bigint(20) NOT NULL COMMENT '商品ID',
  `spec_key` varchar(64) NOT NULL DEFAULT '' COMMENT '规格键；v1统一规格为空串',
  `spec_text` varchar(256) NOT NULL DEFAULT '默认' COMMENT '规格展示快照',
  `quantity` int(11) NOT NULL DEFAULT '1' COMMENT '数量',
  `checked` char(1) NOT NULL DEFAULT '1' COMMENT '0未勾选1已勾选',
  `create_time` datetime DEFAULT NULL COMMENT '加购时间',
  `update_time` datetime DEFAULT NULL COMMENT '更新时间',
  PRIMARY KEY (`cart_item_id`),
  UNIQUE KEY `uk_member_goods_spec` (`member_id`, `goods_id`, `spec_key`),
  KEY `idx_member_update` (`member_id`, `update_time`),
  KEY `idx_member_shop` (`member_id`, `shop_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='会员购物车';
