数据表设计

tech2023-11-11  79

商城数据表设计

CREATE TABLE good_tables ( id int(10) NOT NULL AUTO_INCREMENT COMMENT ‘主键ID’, goods_name varchar(50) COLLATE utf8_unicode_ci DEFAULT NULL COMMENT ‘商品名称’, goods_img varchar(100) COLLATE utf8_unicode_ci DEFAULT NULL COMMENT ‘商品图片’, model_id int(10) DEFAULT NULL COMMENT ‘模型ID’, category_id int(10) DEFAULT NULL COMMENT ‘分类ID’, price decimal(10,2) DEFAULT NULL COMMENT ‘商品价格’, created_at timestamp NULL DEFAULT NULL COMMENT ‘创建时间’, updated_at timestamp NULL DEFAULT NULL COMMENT ‘更新时间’, deleted_at timestamp NULL DEFAULT NULL COMMENT ‘删除时间’, PRIMARY KEY (id) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci COMMENT=‘商品基础表’;

CREATE TABLE ibrand_multi_groupon ( id int(10) unsigned NOT NULL AUTO_INCREMENT, title varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL, goods_id int(11) NOT NULL, number int(11) NOT NULL, price decimal(15,2) NOT NULL, rate int(11) NOT NULL DEFAULT ‘0’, sort int(11) NOT NULL DEFAULT ‘9’, get_point tinyint(4) NOT NULL DEFAULT ‘0’, status tinyint(4) NOT NULL DEFAULT ‘1’, starts_at datetime NOT NULL, ends_at datetime NOT NULL, tags varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL, created_at timestamp NULL DEFAULT NULL, updated_at timestamp NULL DEFAULT NULL, PRIMARY KEY (id) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT=‘团购表’;

最新回复(0)