87 lines
3.8 KiB
SQL
87 lines
3.8 KiB
SQL
DROP TABLE IF EXISTS `version`;
|
|
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
|
/*!40101 SET character_set_client = utf8 */;
|
|
CREATE TABLE `version` (
|
|
`idx` int(11) NOT NULL AUTO_INCREMENT COMMENT '自增id',
|
|
`version` int(11) NOT NULL DEFAULT '0' COMMENT '版本号',
|
|
PRIMARY KEY (`idx`),
|
|
UNIQUE KEY `version` (`version`)
|
|
) ENGINE=InnoDB AUTO_INCREMENT=10001 DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
|
|
/*!40101 SET character_set_client = @saved_cs_client */;
|
|
|
|
-- 好友相关 --
|
|
drop table if exists `t_friend_ships`;
|
|
CREATE TABLE `t_friend_ships` (
|
|
`idx` bigint NOT NULL AUTO_INCREMENT COMMENT '自增id',
|
|
`account1_id` varchar(60) NOT NULL DEFAULT '',
|
|
`account2_id` varchar(60) NOT NULL DEFAULT '',
|
|
`createtime` int NOT NULL DEFAULT '0' COMMENT '创建时间',
|
|
`modifytime` int NOT NULL DEFAULT '0' COMMENT '修改时间',
|
|
PRIMARY KEY (`idx`),
|
|
UNIQUE KEY `friendship` (`account1_id`,`account2_id`)
|
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_bin
|
|
COMMENT "已经成为好友"
|
|
;
|
|
|
|
drop table if exists `t_friend_pending_requests`;
|
|
CREATE TABLE t_friend_pending_requests (
|
|
`idx` bigint NOT NULL AUTO_INCREMENT COMMENT '自增id',
|
|
sender_account_id varchar(60) NOT NULL DEFAULT '',
|
|
receiver_account_id varchar(60) NOT NULL DEFAULT '',
|
|
request_time int DEFAULT '0',
|
|
flag tinyint DEFAULT '0' COMMENT '0 pending, 1 ok, 2 reject',
|
|
`createtime` int NOT NULL DEFAULT '0' COMMENT '创建时间',
|
|
`modifytime` int NOT NULL DEFAULT '0' COMMENT '修改时间',
|
|
PRIMARY KEY (`idx`),
|
|
UNIQUE KEY `friend_req` (`sender_account_id`,`receiver_account_id`)
|
|
) COMMENT "等待验证的好友请求";
|
|
|
|
-- 公会相关 --
|
|
drop table if exists t_guild;
|
|
CREATE TABLE `t_guild` (
|
|
`idx` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '自增id',
|
|
`name` varchar(48) NOT NULL,
|
|
`leader_account_id` varchar(60) NOT NULL,
|
|
`max_members` int(11) DEFAULT '0',
|
|
`createtime` int(11) NOT NULL DEFAULT '0' COMMENT '创建时间',
|
|
`modifytime` int(11) NOT NULL DEFAULT '0' COMMENT '修改时间',
|
|
PRIMARY KEY (`idx`),
|
|
UNIQUE KEY `guild_name` (`name`,`leader_account_id`)
|
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='公会表';
|
|
|
|
drop table if exists `t_guild_members`;
|
|
CREATE TABLE `t_guild_members` (
|
|
`guild_id` bigint(20) NOT NULL,
|
|
`account_id` varchar(60) COLLATE utf8_bin NOT NULL,
|
|
`level` tinyint(4) DEFAULT '0' COMMENT '成员阶级1会长,2干部,3群众',
|
|
`createtime` int(11) NOT NULL DEFAULT '0' COMMENT '创建时间',
|
|
`modifytime` int(11) NOT NULL DEFAULT '0' COMMENT '修改时间',
|
|
PRIMARY KEY (`guild_id`,`account_id`),
|
|
KEY `idx_account_id` (`account_id`),
|
|
KEY `createtime` (`createtime`)
|
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='公会成员表';
|
|
|
|
drop table if exists `t_guild_logs`;
|
|
CREATE TABLE `t_guild_logs` (
|
|
`idx` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '自增id',
|
|
`guild_id` bigint(20) NOT NULL,
|
|
`account_id` varchar(60) COLLATE utf8_bin NOT NULL,
|
|
`log_type` tinyint NOT NULL DEFAULT '0' COMMENT '日志类型',
|
|
`content` varchar(255) COLLATE utf8_bin NOT NULL DEFAULT '' COMMENT '日志内容',
|
|
`createtime` int(11) NOT NULL DEFAULT '0' COMMENT '创建时间',
|
|
`modifytime` int(11) NOT NULL DEFAULT '0' COMMENT '修改时间',
|
|
PRIMARY KEY (`idx`),
|
|
KEY `guild_name` (`guild_id`,`account_id`, log_type),
|
|
KEY `createtime` (`createtime`)
|
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='公会日志表';
|
|
|
|
drop table if exists `t_guild_pending_request`;
|
|
CREATE TABLE `t_guild_pending_request` (
|
|
`guild_id` bigint(20) NOT NULL,
|
|
`account_id` varchar(60) COLLATE utf8_bin NOT NULL,
|
|
`createtime` int(11) NOT NULL DEFAULT '0' COMMENT '创建时间',
|
|
`modifytime` int(11) NOT NULL DEFAULT '0' COMMENT '修改时间',
|
|
PRIMARY KEY (`guild_id`,`account_id`),
|
|
KEY `account_id` (`account_id`),
|
|
KEY `createtime` (`createtime`)
|
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin COMMENT='公会申请表' |