Skip to content

Commit

Permalink
Add db-modifications.sql
Browse files Browse the repository at this point in the history
This file adds more indexes to the database to improve performance
  • Loading branch information
niekcandaele committed Jun 27, 2020
1 parent 40b8ccd commit e9b81e4
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions db-modifications.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
/* Complex schemas are not great in Sails auto migrations
If you are running a CSMM instance with many servers or have high data throughput these commands can help you out. */

--- Indexes
ALTER TABLE sdtdconfig ADD INDEX IDX_sdtdconfig_server (`server` ASC);
ALTER TABLE historicalinfo ADD INDEX IDX_historicalinfo_createdAt (`createdAt` ASC);
ALTER TABLE player ADD INDEX IDX_player_steamId_server (`steamId` ASC, `server` ASC);
ALTER TABLE analytics ADD INDEX IDX_analytics_createdAt_server (`createdAt` ASC, `server` ASC);
ALTER TABLE trackinginfo ADD INDEX createdAt (createdAt ASC);
ALTER TABLE trackinginfo ADD INDEX server (server ASC);
ALTER TABLE customdiscordnotification ADD INDEX IDX_customdiscordnotification_server (`server` ASC);


-- Data types
ALTER TABLE gblcomment MODIFY content TEXT;
ALTER TABLE sdtdconfig MODIFY votingCommand TEXT;
ALTER TABLE customcommand MODIFY commandsToExecute TEXT;
ALTER TABLE customhook MODIFY commandsToExecute TEXT;
ALTER TABLE cronjob MODIFY command TEXT;
ALTER TABLE banentry MODIFY reason TEXT;

0 comments on commit e9b81e4

Please sign in to comment.