From 266cc701e33a5bfaaf67b064dcb86ff024ad9b0a Mon Sep 17 00:00:00 2001 From: alexkar598 <25136265+alexkar598@users.noreply.github.com> Date: Wed, 25 Aug 2021 19:10:19 -0400 Subject: [PATCH] Adds an index on erro_connection_log for yogbot review command (#12065) * Adds an index on erro_connection_log for yogbot review command * r * Comma * Wrong comma * Update database_changelog.txt --- SQL/database_changelog.txt | 14 +++++++++++--- SQL/tgstation_schema.sql | 3 ++- SQL/tgstation_schema_prefixed.sql | 3 ++- code/__DEFINES/subsystems.dm | 2 +- 4 files changed, 16 insertions(+), 6 deletions(-) diff --git a/SQL/database_changelog.txt b/SQL/database_changelog.txt index 56e9a581f93c..cebee65aeb18 100644 --- a/SQL/database_changelog.txt +++ b/SQL/database_changelog.txt @@ -1,13 +1,21 @@ Any time you make a change to the schema files, remember to increment the database schema version. Generally increment the minor number, major should be reserved for significant changes to the schema. Both values go up to 255. -The latest database version is 5.5; The query to update the schema revision table is: +The latest database version is 5.6; The query to update the schema revision table is: -INSERT INTO `schema_revision` (`major`, `minor`) VALUES (5, 5); +INSERT INTO `schema_revision` (`major`, `minor`) VALUES (5, 6); or -INSERT INTO `SS13_schema_revision` (`major`, `minor`) VALUES (5, 5); +INSERT INTO `SS13_schema_revision` (`major`, `minor`) VALUES (5, 6); In any query remember to add a prefix to the table names if you use one. +version 5.6 14 August 2021, by alexkar598 + +Adds index on connection_log + +create index idx_review + on connection_log (ckey, computerid, ip); + + ---------------------------------------------------- version 5.5 14 August 2021, by JamieD1 diff --git a/SQL/tgstation_schema.sql b/SQL/tgstation_schema.sql index 72c86bfc269f..16c0e15365c0 100644 --- a/SQL/tgstation_schema.sql +++ b/SQL/tgstation_schema.sql @@ -117,7 +117,8 @@ CREATE TABLE IF NOT EXISTS `connection_log` ( `ckey` varchar(45) DEFAULT NULL, `ip` int(10) unsigned NOT NULL, `computerid` varchar(45) DEFAULT NULL, - PRIMARY KEY (`id`) + PRIMARY KEY (`id`), + KEY `idx_review` (`ckey`, `computerid`, `ip`) ) ENGINE=InnoDB AUTO_INCREMENT=4192042 DEFAULT CHARSET=utf8; diff --git a/SQL/tgstation_schema_prefixed.sql b/SQL/tgstation_schema_prefixed.sql index e416bec46842..ad958f967a90 100644 --- a/SQL/tgstation_schema_prefixed.sql +++ b/SQL/tgstation_schema_prefixed.sql @@ -117,7 +117,8 @@ CREATE TABLE IF NOT EXISTS `SS13_connection_log` ( `ckey` varchar(45) DEFAULT NULL, `ip` int(10) unsigned NOT NULL, `computerid` varchar(45) DEFAULT NULL, - PRIMARY KEY (`id`) + PRIMARY KEY (`id`), + KEY `idx_review` (`ckey`, `computerid`, `ip`) ) ENGINE=InnoDB AUTO_INCREMENT=4192042 DEFAULT CHARSET=utf8; diff --git a/code/__DEFINES/subsystems.dm b/code/__DEFINES/subsystems.dm index a3c1664fbd79..e2ec5006c541 100644 --- a/code/__DEFINES/subsystems.dm +++ b/code/__DEFINES/subsystems.dm @@ -20,8 +20,8 @@ * * make sure you add an update to the schema_version stable in the db changelog */ -#define DB_MINOR_VERSION 5 +#define DB_MINOR_VERSION 6 //! ## Timing subsystem /**