构建数据库 common/models/member/MemberCart.py
DROP TABLE IF EXISTS `member_cart`;
CREATE TABLE `member_cart` (
`id` int(11) unsigned NOT NULL AUTO_INCREMENT,
`member_id` bigint(20) NOT NULL DEFAULT '0' COMMENT '会员id',
`food_id` int(11) NOT NULL DEFAULT '0' COMMENT '商品id',
`quantity` int(11) NOT NULL DEFAULT '0' COMMENT '数量',
`updated_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '最后一次更新时间',
`created_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '插入时间',
PRIMARY KEY (`id`),
KEY `idx_member_id` (`member_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='购物车';
flask-sqlacodegen 'mysql://root:root@127.0.0.1/food_db' --tables member_cart --outfile "common/models/member/MemberCart.py" --flask