game2001api/sql/gamedb2001_n_migrate_190829_01.sql
aozhiwei 277c87e01e 1
2019-08-29 14:13:56 +08:00

31 lines
1.4 KiB
PL/PgSQL
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

begin;
CREATE TABLE `redpack` (
`idx` int(11) NOT NULL AUTO_INCREMENT COMMENT '自增id',
`red_type` int(11) NOT NULL DEFAULT '0' COMMENT '红包类型(1:红包雨红包,2:邀请好友红包)',
`red_sum` double NOT NULL DEFAULT '0' COMMENT '红包金额(已发放的)',
`red_date` int(11) NOT NULL DEFAULT '0' COMMENT '日期某天时间的00:00:00',
`create_time` int(11) NOT NULL DEFAULT '0' COMMENT '创建时间',
`modify_time` int(11) NOT NULL DEFAULT '0' COMMENT '修改时间',
PRIMARY KEY (`idx`),
UNIQUE KEY `red_type_red_date` (`red_type`, `red_date`)
) ENGINE=InnoDB AUTO_INCREMENT=10001 DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
CREATE TABLE `redpack_log` (
`idx` int(11) NOT NULL AUTO_INCREMENT COMMENT '自增id',
`accountid` varchar(60) DEFAULT '' COMMENT '账号id(channel + "_" + gameid + "_" + openid)',
`order_id` varchar(60) DEFAULT '' COMMENT '订单id',
`get_time` int(11) NOT NULL DEFAULT '0' COMMENT '领取时间',
`coin_num` int(11) NOT NULL DEFAULT '0' COMMENT '金钱数量',
`custom_data` mediumblob COMMENT '其他字段',
`createtime` int(11) NOT NULL DEFAULT '0' COMMENT '创建时间',
`modifytime` int(11) NOT NULL DEFAULT '0' COMMENT '修改时间',
PRIMARY KEY (`idx`),
UNIQUE KEY `account_order_id_get_time` (`accountid`, `order_id` , `get_time`)
) ENGINE=InnoDB AUTO_INCREMENT=10001 DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
insert into version (version) values(2019082901);
commit;