MySQL建表SQL语句
数据库结构:商城系统-优惠券发放记录表:https://open.yesapi.cn/tablelist/yesapi_yshopmall_yx_store_coupon_user.html
-- 数据库大全:商城系统-优惠券发放记录表
-- 来源:YesApi.cn
CREATE TABLE `yesapi_yshopmall_yx_store_coupon_user` (
`id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
`cid` int(10) NULL DEFAULT '0' COMMENT '兑换的项目id',
`uid` bigint(20) NULL DEFAULT '0' COMMENT '优惠券所属用户',
`coupon_title` varchar(32) NULL COMMENT '优惠券名称',
`coupon_price` decimal(8,2) unsigned NULL DEFAULT '0.00' COMMENT '优惠券的面值',
`use_min_price` decimal(8,2) unsigned NULL DEFAULT '0.00' COMMENT '最低消费多少金额可用优惠券',
`create_time` datetime NULL COMMENT '优惠券创建时间',
`end_time` datetime NULL COMMENT '优惠券结束时间',
`use_time` datetime NULL COMMENT '使用时间',
`yesapi_yshopmall_yx_store_coupon_user_type` varchar(32) NULL DEFAULT 'send' COMMENT '获取方式',
`yesapi_yshopmall_yx_store_coupon_user_status` tinyint(1) NULL DEFAULT '0' COMMENT '状态(0:未使用,1:已使用, 2:已过期)',
`is_fail` tinyint(3) NULL DEFAULT '0' COMMENT '是否有效',
`is_del` tinyint(1) NULL DEFAULT '0' COMMENT '',
KEY `cid` (`cid`),
KEY `uid` (`uid`),
KEY `create_time` (`create_time`),
KEY `end_time` (`end_time`),
KEY `yesapi_yshopmall_yx_store_coupon_user_status` (`yesapi_yshopmall_yx_store_coupon_user_status`),
KEY `is_fail` (`is_fail`),
PRIMARY KEY (`id`)
) ENGINE=InnoDB COMMENT '商城系统-优惠券发放记录表';
复制后,到数据库执行,即可创建此数据库表。
MySQL数据库表结构设计
第 1-12 条, 共 12 条.
字段名称 | 字段类型 | 字段默认值 | 是否允许为空 | 字段描述 | 索引 | 字段数据示例 |
---|---|---|---|---|---|---|
cid | int(10) | 0 | 否 | 兑换的项目id | 普通索引 | 0 |
uid | bigint(20) | 0 | 否 | 优惠券所属用户 | 普通索引 | 0 |
coupon_title | varchar(32) | 否 | 优惠券名称 | 无索引 | ||
coupon_price | decimal(8,2) unsigned | 0.00 | 否 | 优惠券的面值 | 无索引 | 0.00 |
use_min_price | decimal(8,2) unsigned | 0.00 | 否 | 最低消费多少金额可用优惠券 | 无索引 | 0.00 |
create_time | datetime | 否 | 优惠券创建时间 | 普通索引 | ||
end_time | datetime | 否 | 优惠券结束时间 | 普通索引 | ||
use_time | datetime | 是 | 使用时间 | 无索引 | ||
yesapi_yshopmall_yx_store_coupon_user_type | varchar(32) | send | 否 | 获取方式 | 无索引 | send |
yesapi_yshopmall_yx_store_coupon_user_status | tinyint(1) | 0 | 否 | 状态(0:未使用,1:已使用, 2:已过期) | 普通索引 | 0 |
is_fail | tinyint(3) | 0 | 否 | 是否有效 | 普通索引 | 0 |
is_del | tinyint(1) | 0 | 是 | 无索引 | 0 |