parent
1834e09c0f
commit
0f0f9a1246
3 changed files with 12 additions and 5 deletions
7
servatrice/migrations/servatrice_0016_to_0017.sql
Normal file
7
servatrice/migrations/servatrice_0016_to_0017.sql
Normal file
|
@ -0,0 +1,7 @@
|
||||||
|
-- Servatrice db migration from version 16 to version 17
|
||||||
|
|
||||||
|
alter table cockatrice_rooms modify column `id_server` tinyint(3) not null default 1;
|
||||||
|
alter table cockatrice_rooms_gametypes modify column `id_server` tinyint(3) not null default 1;
|
||||||
|
alter table cockatrice_servermessages modify column `id_server` tinyint(3) not null default 1;
|
||||||
|
|
||||||
|
UPDATE cockatrice_schema_version SET version=17 WHERE version=16;
|
|
@ -20,7 +20,7 @@ CREATE TABLE IF NOT EXISTS `cockatrice_schema_version` (
|
||||||
PRIMARY KEY (`version`)
|
PRIMARY KEY (`version`)
|
||||||
) ENGINE=INNODB DEFAULT CHARSET=utf8;
|
) ENGINE=INNODB DEFAULT CHARSET=utf8;
|
||||||
|
|
||||||
INSERT INTO cockatrice_schema_version VALUES(16);
|
INSERT INTO cockatrice_schema_version VALUES(17);
|
||||||
|
|
||||||
-- users and user data tables
|
-- users and user data tables
|
||||||
CREATE TABLE IF NOT EXISTS `cockatrice_users` (
|
CREATE TABLE IF NOT EXISTS `cockatrice_users` (
|
||||||
|
@ -90,14 +90,14 @@ CREATE TABLE IF NOT EXISTS `cockatrice_rooms` (
|
||||||
`auto_join` tinyint(1) default 0,
|
`auto_join` tinyint(1) default 0,
|
||||||
`join_message` varchar(255) NOT NULL,
|
`join_message` varchar(255) NOT NULL,
|
||||||
`chat_history_size` int(4) NOT NULL,
|
`chat_history_size` int(4) NOT NULL,
|
||||||
`id_server` tinyint(3) NOT NULL,
|
`id_server` tinyint(3) NOT NULL DEFAULT 1,
|
||||||
PRIMARY KEY (`id`)
|
PRIMARY KEY (`id`)
|
||||||
) ENGINE=INNODB DEFAULT CHARSET=utf8;
|
) ENGINE=INNODB DEFAULT CHARSET=utf8;
|
||||||
|
|
||||||
CREATE TABLE IF NOT EXISTS `cockatrice_rooms_gametypes` (
|
CREATE TABLE IF NOT EXISTS `cockatrice_rooms_gametypes` (
|
||||||
`id_room` int(7) unsigned NOT NULL,
|
`id_room` int(7) unsigned NOT NULL,
|
||||||
`name` varchar(50) NOT NULL,
|
`name` varchar(50) NOT NULL,
|
||||||
`id_server` tinyint(3) NOT NULL,
|
`id_server` tinyint(3) NOT NULL DEFAULT 1,
|
||||||
FOREIGN KEY(`id_room`) REFERENCES `cockatrice_rooms`(`id`) ON DELETE CASCADE ON UPDATE CASCADE
|
FOREIGN KEY(`id_room`) REFERENCES `cockatrice_rooms`(`id`) ON DELETE CASCADE ON UPDATE CASCADE
|
||||||
) ENGINE=INNODB DEFAULT CHARSET=utf8;
|
) ENGINE=INNODB DEFAULT CHARSET=utf8;
|
||||||
|
|
||||||
|
@ -167,7 +167,7 @@ CREATE TABLE IF NOT EXISTS `cockatrice_uptime` (
|
||||||
) ENGINE=INNODB DEFAULT CHARSET=utf8;
|
) ENGINE=INNODB DEFAULT CHARSET=utf8;
|
||||||
|
|
||||||
CREATE TABLE IF NOT EXISTS `cockatrice_servermessages` (
|
CREATE TABLE IF NOT EXISTS `cockatrice_servermessages` (
|
||||||
`id_server` tinyint(3) not null default 0,
|
`id_server` tinyint(3) not null default 1,
|
||||||
`timest` datetime NOT NULL default '0000-00-00 00:00:00',
|
`timest` datetime NOT NULL default '0000-00-00 00:00:00',
|
||||||
`message` text,
|
`message` text,
|
||||||
PRIMARY KEY (`timest`)
|
PRIMARY KEY (`timest`)
|
||||||
|
|
|
@ -9,7 +9,7 @@
|
||||||
#include "server.h"
|
#include "server.h"
|
||||||
#include "server_database_interface.h"
|
#include "server_database_interface.h"
|
||||||
|
|
||||||
#define DATABASE_SCHEMA_VERSION 16
|
#define DATABASE_SCHEMA_VERSION 17
|
||||||
|
|
||||||
class Servatrice;
|
class Servatrice;
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue