20180816142744.sql
1.25 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
/*
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;