mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-07-18 08:22:15 -07:00
Support more indices
This commit is contained in:
parent
090cc8c144
commit
e0a3855fca
3 changed files with 11 additions and 3 deletions
6
servatrice/migrations/servatrice_0032_to_0033.sql
Normal file
6
servatrice/migrations/servatrice_0032_to_0033.sql
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
-- Servatrice db migration from version 32 to version 33
|
||||
|
||||
ALTER TABLE cockatrice_user_analytics ADD INDEX `idx_last_login` (`last_login`);
|
||||
ALTER TABLE cockatrice_sessions ADD INDEX `idx_end_time` (`end_time`);
|
||||
|
||||
UPDATE cockatrice_schema_version SET version=33 WHERE version=32;
|
||||
|
|
@ -20,7 +20,7 @@ CREATE TABLE IF NOT EXISTS `cockatrice_schema_version` (
|
|||
PRIMARY KEY (`version`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 DEFAULT COLLATE utf8mb4_unicode_ci;
|
||||
|
||||
INSERT INTO cockatrice_schema_version VALUES(32);
|
||||
INSERT INTO cockatrice_schema_version VALUES(33);
|
||||
|
||||
-- users and user data tables
|
||||
CREATE TABLE IF NOT EXISTS `cockatrice_users` (
|
||||
|
|
@ -197,7 +197,8 @@ CREATE TABLE IF NOT EXISTS `cockatrice_sessions` (
|
|||
KEY `username` (`user_name`),
|
||||
INDEX `idx_start_time` (`start_time`),
|
||||
INDEX `idx_clientid` (`clientid`),
|
||||
INDEX `idx_ip_address` (`ip_address`)
|
||||
INDEX `idx_ip_address` (`ip_address`),
|
||||
INDEX `idx_end_time` (`end_time`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 DEFAULT COLLATE utf8mb4_unicode_ci;
|
||||
|
||||
-- server moderation
|
||||
|
|
@ -258,6 +259,7 @@ CREATE TABLE IF NOT EXISTS `cockatrice_user_analytics` (
|
|||
`last_login` datetime NOT NULL,
|
||||
`notes` varchar(255) NOT NULL,
|
||||
PRIMARY KEY (`id`),
|
||||
INDEX `idx_last_login` (`last_login`),
|
||||
FOREIGN KEY(`id`) REFERENCES `cockatrice_users`(`id`) ON DELETE CASCADE ON UPDATE CASCADE
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 DEFAULT COLLATE utf8mb4_unicode_ci;
|
||||
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@
|
|||
#include <QObject>
|
||||
#include <QSqlDatabase>
|
||||
|
||||
#define DATABASE_SCHEMA_VERSION 32
|
||||
#define DATABASE_SCHEMA_VERSION 33
|
||||
|
||||
class Servatrice;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue