Update database schemas (#1546)

This commit is contained in:
Annika 2020-07-09 04:59:45 -07:00 committed by GitHub
parent 95d4013c8c
commit 1717e14d53
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 51 additions and 15 deletions

View File

@ -39,7 +39,7 @@ CREATE TABLE IF NOT EXISTS `ntbb_ladder` (
PRIMARY KEY (`entryid`),
UNIQUE KEY `userformats` (`userid`,`formatid`),
KEY `formattoplist` (`formatid`,`elo`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin AUTO_INCREMENT=1 ;
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin AUTO_INCREMENT=1;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;

16
lib/ntbb-usermodlog.sql Normal file
View File

@ -0,0 +1,16 @@
--
-- Table structure for table `ntbb_usermodlog`
--
CREATE TABLE `ntbb_usermodlog` (
`entryid` int(11) NOT NULL AUTO_INCREMENT,
`userid` varchar(63) CHARACTER SET latin1 NOT NULL,
`actorid` varchar(63) CHARACTER SET latin1 NOT NULL,
`date` int(11) NOT NULL,
`ip` varchar(63) CHARACTER SET latin1 NOT NULL,
`entry` varchar(1023) CHARACTER SET latin1 NOT NULL,
PRIMARY KEY (`entryid`),
KEY `userid` (`userid`),
KEY `actorid` (`actorid`),
KEY `ip` (`ip`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

14
lib/ntbb-userstats.sql Normal file
View File

@ -0,0 +1,14 @@
--
-- Table structure for table `ntbb_userstats`
--
DROP TABLE IF EXISTS `ntbb_userstats`;
CREATE TABLE `ntbb_userstats` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`serverid` varchar(255) NOT NULL,
`date` bigint(20) NOT NULL,
`usercount` int(11) NOT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `serverid` (`serverid`),
KEY `date` (`date`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

View File

@ -0,0 +1,15 @@
--
-- Table structure for table `ntbb_userstatshistory`
--
CREATE TABLE `ntbb_userstatshistory` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`date` bigint(20) NOT NULL,
`usercount` int(11) NOT NULL,
`programid` enum('showdown','po') NOT NULL DEFAULT 'showdown',
PRIMARY KEY (`id`),
KEY `date` (`date`),
KEY `usercount` (`usercount`),
KEY `programid` (`programid`),
KEY `maxusers` (`programid`,`usercount`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

View File

@ -1,16 +1,6 @@
-- Database: ps_replays
-- Generation Time: 2019-06-21 16:25:02.7010
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8mb4 */;
/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */;
/*!40103 SET TIME_ZONE='+00:00' */;
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
--
-- Table structure for table `ps_replays`
--
CREATE TABLE `ps_replays` (
`id` varbinary(255) NOT NULL DEFAULT '',
@ -26,10 +16,11 @@ CREATE TABLE `ps_replays` (
`formatid` varbinary(45) NOT NULL,
`rating` int(11) NOT NULL DEFAULT '0',
`private` tinyint(1) NOT NULL,
`password` varchar(31) DEFAULT NULL,
PRIMARY KEY (`id`),
KEY `p1` (`private`,`p1id`,`uploadtime`),
KEY `p2` (`private`,`p2id`,`uploadtime`),
KEY `top` (`private`,`formatid`,`rating`),
KEY `format` (`private`,`formatid`,`uploadtime`),
KEY `recent` (`private`,`uploadtime`)
) ENGINE=TokuDB DEFAULT CHARSET=utf8mb4;
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;