game2006api/sql/gamedb2006_migrate_231219_01.sql
2023-12-21 17:02:53 +08:00

50 lines
2.4 KiB
PL/PgSQL

begin;
CREATE TABLE `t_unlocked_map` (
`idx` bigint NOT NULL AUTO_INCREMENT COMMENT '自增id',
`account_id` varchar(60) NOT NULL DEFAULT '' COMMENT '账号id(channel + "_" + gameid + "_" + openid)',
`map_id` int(11) NOT NULL COMMENT '地图ID',
`unlockedtime` int(11) NOT NULL DEFAULT '0' COMMENT '激活时间',
`createtime` int(11) NOT NULL DEFAULT '0' COMMENT '创建时间',
`modifytime` int(11) NOT NULL DEFAULT '0' COMMENT '修改时间',
PRIMARY KEY (`idx`),
UNIQUE KEY `account_map_id` (`account_id`, `map_id`)
) ENGINE=InnoDB AUTO_INCREMENT=10001 DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
CREATE TABLE `t_exchange_code` (
`idx` bigint NOT NULL AUTO_INCREMENT COMMENT '自增id',
`exchangecode` varchar(16) NOT NULL COMMENT '兑换码',
`packageno` varchar(32) NOT NULL COMMENT '礼包id',
`codetype` int(11) NOT NULL COMMENT '兑换码类型',
`memo` varchar(40) NOT NULL DEFAULT '0' COMMENT '备注',
`channellist` varchar(255) NOT NULL DEFAULT '' COMMENT '绑定渠道列表',
`batchid` int(11) NOT NULL DEFAULT '0' COMMENT '兑换码批次号',
`usetimes` int(11) NOT NULL DEFAULT '0' COMMENT '使用次数',
`last_usetime` int(11) NOT NULL DEFAULT '0' COMMENT '最后使用时间',
`last_useuser` varchar(64) NOT NULL DEFAULT '' COMMENT '最后使用者',
`begindate` int(11) NOT NULL DEFAULT '0' COMMENT '开始时间',
`enddate` int(11) NOT NULL DEFAULT '0' COMMENT '结束时间',
`createtime` int(11) NOT NULL DEFAULT '0' COMMENT '创建时间',
`modifytime` int(11) NOT NULL DEFAULT '0' COMMENT '修改时间',
PRIMARY KEY (`idx`),
UNIQUE KEY `exchangecode` (`exchangecode`)
) ENGINE=InnoDB AUTO_INCREMENT=10001 DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
CREATE TABLE `t_exchange_record` (
`idx` bigint NOT NULL AUTO_INCREMENT COMMENT '自增id',
`account_id` varchar(60) NOT NULL DEFAULT '' COMMENT '账号id(channel + "_" + gameid + "_" + openid)',
`exchangecode` varchar(16) NOT NULL COMMENT '兑换码',
`packageno` varchar(32) NOT NULL COMMENT '礼包id',
`codetype` int(11) NOT NULL COMMENT '兑换码类型',
`createtime` int(11) NOT NULL DEFAULT '0' COMMENT '创建时间',
`modifytime` int(11) NOT NULL DEFAULT '0' COMMENT '修改时间',
PRIMARY KEY (`idx`),
UNIQUE KEY `exchangecode_account` (`exchangecode`,`account_id`)
) ENGINE=InnoDB AUTO_INCREMENT=10001 DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
insert into version (version) values(2023092001);
commit;