20180816142744.sql 1.25 KB
/*
    true
    @author: qiuj <jun.qiu@yoho.cn>
    @date: 2018-08-16 14:27:44
*/
#注意:GO;分割执行块
#优惠券码表
DROP TABLE IF EXISTS `act_coupon_no`;
GO;
CREATE TABLE `act_coupon_no` (
  `id` int(8) NOT NULL PRIMARY KEY AUTO_INCREMENT,
  `coupon_id` int(8) NOT NULL,
  `coupon_no` varchar(50) DEFAULT NULL,
  `send_flag` int(2) NOT NULL DEFAULT '0',
  `create_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP
) DEFAULT CHARSET=utf8;
GO;

#用户领券信息表
DROP TABLE IF EXISTS `act_coupon_user`;
GO;
CREATE TABLE `act_coupon_user` (
  `id` int(8) NOT NULL PRIMARY KEY AUTO_INCREMENT,
  `coupon_id` int(8) NOT NULL,
  `coupon_no_id` int(8) NOT NULL,
  `user_id` int(8) NOT NULL,
  `create_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP
) DEFAULT CHARSET=utf8;
GO;

#优惠券表
DROP TABLE IF EXISTS `act_coupon`;
GO;
CREATE TABLE `act_coupon` (
  `id` int(8) NOT NULL PRIMARY KEY AUTO_INCREMENT,
  `coupon_name` varchar(50) NOT NULL,
  `coupon_desc` varchar(400) DEFAULT NULL,
  `shop_name` varchar(50) NOT NULL,
  `shop_logo_url` varchar(200) NOT NULL,
  `status` int(2) NOT NULL DEFAULT '0',
  `type` int(2) NOT NULL DEFAULT '0',
  `sort` int(8) NOT NULL DEFAULT '0',
  `create_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP
) DEFAULT CHARSET=utf8;