82 lines
3.1 KiB
SQL
82 lines
3.1 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_pending_friend_requests`;
|
|
CREATE TABLE t_pending_friend_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 NOT NULL AUTO_INCREMENT COMMENT '自增id',
|
|
name VARCHAR(255) NOT NULL,
|
|
leader_id VARCHAR(255) NOT NULL,
|
|
max_members INT DEFAULT "0",
|
|
level INT default "0",
|
|
exp INT default "0",
|
|
badge INT default "0",
|
|
`createtime` int NOT NULL DEFAULT '0' COMMENT '创建时间',
|
|
`modifytime` int NOT NULL DEFAULT '0' COMMENT '修改时间',
|
|
PRIMARY KEY (`idx`),
|
|
UNIQUE KEY `guild_name` (`name`,`leader_id`)
|
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_bin
|
|
COMMENT "公会表"
|
|
;
|
|
|
|
drop table if exists t_guild_members;
|
|
CREATE TABLE t_guild_members (
|
|
guild_id INT NOT NULL,
|
|
account_id VARCHAR(255) NOT NULL,
|
|
`createtime` int NOT NULL DEFAULT '0' COMMENT '创建时间',
|
|
`modifytime` int NOT NULL DEFAULT '0' COMMENT '修改时间',
|
|
PRIMARY KEY (`guild_id`, `account_id`),
|
|
key createtime(`createtime`)
|
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_bin
|
|
COMMENT "公会成员表"
|
|
;
|
|
|
|
drop table if exists t_guild_logs;
|
|
CREATE TABLE t_guild_logs (
|
|
`idx` bigint NOT NULL AUTO_INCREMENT COMMENT '自增id',
|
|
guild_id INT NOT NULL,
|
|
account_id VARCHAR(255) NOT NULL,
|
|
log_type tinyint NOT NULL default '0' COMMENT "日志类型",
|
|
`createtime` int NOT NULL DEFAULT '0' COMMENT '创建时间',
|
|
`modifytime` int NOT NULL DEFAULT '0' COMMENT '修改时间',
|
|
PRIMARY KEY (`idx`),
|
|
key guild_name(`guild_id`, `account_id`, `log_type`),
|
|
key createtime(`createtime`)
|
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_bin
|
|
COMMENT "公会日志表"
|
|
; |