Implement SQL migrations with Flyway (#1661)

Has a readme and everything.

Tables to be dropped with this:

ss13_customitems
ss13_bot_cache
ss13_feedback_archive
ss13_news
ss13_stats_ie
This commit is contained in:
skull132
2017-01-29 21:14:58 +02:00
committed by GitHub
parent 0cba68911d
commit b1b4ce00a8
5 changed files with 614 additions and 250 deletions
+81
View File
@@ -0,0 +1,81 @@
### Prerequisites
The server connects to a mysql-compatible server (mysql, mariadb, percona), so you'll need one of those with a database and user/password pair ready.
We use [flyway](https://flywaydb.org/) to manage database migrations. To set up the database, you'll need to [download flyway](https://flywaydb.org/getstarted/download.html).
You'll also need some proficiency with the command line.
----
### Attribution
Credit to Mloc from Baystation12 for the initial readme.
---
### Creating migrations
As a coder, creating migrations is relatively easy. And they're a lot more flexible than just updating the initial schema would be.
First, figure out the changes you need to make. From table alteration and creation commands, to simply update and insert statements.
Write them into a .sql file in the SQL/migrate folder, in a valid order of execution. Name the file in the following format:
Vxxx__Description_goes_here.sql
Where `xxx` is the next version number from the last existing file (include the 0s), and the descrption is a short description for the migration, with spaces replaced by underscores.
Push this to your branch, and you're done!
---
### Initial setup
In the root project directory, run:
path/to/flyway migrate -user=USER -password=PASSWORD -url=jdbc:mysql://HOST/DATABASE
Where USER is your mysql username, PASSWORD is your mysql password, HOST is the hostname of the mysql server and DATABASE is the database to use.
---
### Migrating
Use the same command as above. Handy, isn't it?
---
### Using a pre-flyway database
**Note that this is not recommended!**
You may run into issues with some migrations, due to improper versioning. The best way to utilize this system is to set everything up on an empty schema.
The next alternative is to make sure your database structure matches the V001 file within the migrate folder by manually modifying the structure to avoid dataloss, and then doing the steps described below.
If you're using a database since before we moved to flyway, it's a bit more involved to get migrations working.
In the root project directory, run:
path/to/flyway baseline -user=USER -password=PASSWORD -url=jdbc:mysql://HOST/DATABASE -baselineVersion=001 -baselineDescription="Initial schema"
From there, you can run migrations as normal.
---
### Configuration file
Instead of putting -user, -password and -url in the command line every time you execute flyway, you can use a config file. Create it somewhere in the root of your project (we're calling it 'db.conf'):
flyway.url=jdbc:mysql://HOST/DATABASE
flyway.user=USER
flyway.password=PASSWORD
Now you can just run `flyway migrate -configFile=db.conf`, and the settings will be loaded from config.
---
### Misc tables
We included a set of miscellanious tables in the misc folder. These are primarily used for debugging and are not meant to be pushed into production. As such, they're not included in the migration folder.
Ignoring or implementing them should not cause issues with the system.
@@ -1,15 +1,92 @@
CREATE DATABASE `spacestation13` /*!40100 DEFAULT CHARACTER SET utf8 */;
-- ------------------------------------------------------------
-- These are BOREALIS' tables. Some are actively used ingame,
-- hence why they're bundled in here.
-- ------------------------------------------------------------
CREATE TABLE `ss13_admin` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`ckey` varchar(32) CHARACTER SET latin1 NOT NULL,
`rank` varchar(32) CHARACTER SET latin1 NOT NULL DEFAULT 'Administrator',
`level` int(2) NOT NULL DEFAULT '0',
`flags` int(16) NOT NULL DEFAULT '0',
`discord_id` varchar(45) NOT NULL DEFAULT '',
--
-- BOREALIS' table for bans
--
CREATE TABLE `discord_bans` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`user_id` varchar(45) NOT NULL,
`user_name` varchar(45) NOT NULL,
`server_id` varchar(45) NOT NULL,
`ban_type` varchar(45) NOT NULL,
`ban_duration` int(11) NOT NULL DEFAULT '-1',
`ban_reason` longtext,
`ban_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
`expiration_time` datetime NOT NULL,
`admin_id` varchar(45) DEFAULT NULL,
`admin_name` varchar(45) DEFAULT 'BOREALIS',
`ban_lifted` datetime DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
--
-- BOREALIS' table for channels
--
CREATE TABLE `discord_channels` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`channel_group` varchar(32) NOT NULL,
`channel_id` text NOT NULL,
`pin_flag` int(11) NOT NULL DEFAULT '0',
`server_id` varchar(45) NOT NULL DEFAULT '',
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
--
-- BOREALIS' table for logs
--
CREATE TABLE `discord_log` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`action_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
`action` text NOT NULL,
`admin_id` varchar(45) DEFAULT NULL,
`user_id` varchar(45) DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
--
-- BOREALIS' table for strikes
--
CREATE TABLE `discord_strikes` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`user_id` varchar(45) NOT NULL,
`user_name` varchar(45) NOT NULL,
`action_type` varchar(45) NOT NULL DEFAULT 'WARNING',
`strike_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
`admin_id` varchar(45) NOT NULL,
`admin_name` varchar(45) NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
--
-- BOREALIS' table for subscriptions
--
CREATE TABLE `discord_subscribers` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`user_id` varchar(45) NOT NULL,
`once` tinyint(1) NOT NULL DEFAULT '0',
`subscribed_at` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
`expired_at` datetime DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
-- ------------------------------------------------------------
-- SS13 tables begin here. All of these are actively used.
-- Note that some are used by the WebInterface, but if so,
-- it's done in support of ingame systems.
-- ------------------------------------------------------------
--
-- Table for admin rank alterations
--
CREATE TABLE `ss13_admin_log` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`datetime` datetime NOT NULL,
@@ -19,43 +96,50 @@ CREATE TABLE `ss13_admin_log` (
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE `ss13_api_commands` (
`id` INT(11) NOT NULL AUTO_INCREMENT,
`command` VARCHAR(50) NOT NULL COLLATE 'utf8_bin',
`description` VARCHAR(255) NULL DEFAULT NULL COLLATE 'utf8_bin',
PRIMARY KEY (`id`),
UNIQUE INDEX `UNIQUE command` (`command`)
)
COLLATE='utf8_bin'
ENGINE=InnoDB;
--
-- Table for the server-supported API/world.Topic commands
--
CREATE TABLE `ss13_api_commands` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`command` varchar(50) COLLATE utf8_bin NOT NULL,
`description` varchar(255) COLLATE utf8_bin DEFAULT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `UNIQUE command` (`command`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
--
-- Table for auth tokens for world.Topic
--
CREATE TABLE `ss13_api_tokens` (
`id` INT(11) NOT NULL AUTO_INCREMENT,
`token` VARCHAR(100) NOT NULL COLLATE 'utf8_bin',
`ip` VARCHAR(16) NULL DEFAULT NULL COLLATE 'utf8_bin',
`creator` VARCHAR(50) NOT NULL COLLATE 'utf8_bin',
`description` VARCHAR(100) NOT NULL COLLATE 'utf8_bin',
`created_at` DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
`updated_at` DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
`deleted_at` DATETIME NULL DEFAULT NULL,
PRIMARY KEY (`id`)
)
COLLATE='utf8_bin'
ENGINE=InnoDB;
`id` int(11) NOT NULL AUTO_INCREMENT,
`token` varchar(100) COLLATE utf8_bin NOT NULL,
`ip` varchar(16) COLLATE utf8_bin DEFAULT NULL,
`creator` varchar(50) COLLATE utf8_bin NOT NULL,
`description` varchar(100) COLLATE utf8_bin NOT NULL,
`created_at` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
`updated_at` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
`deleted_at` datetime DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
--
-- Table to describe which tokens can access what commands for world.Topic
--
CREATE TABLE `ss13_api_token_command` (
`command_id` INT(11) NOT NULL,
`token_id` INT(11) NOT NULL,
PRIMARY KEY (`command_id`, `token_id`),
INDEX `token_id` (`token_id`),
CONSTRAINT `function_id` FOREIGN KEY (`command_id`) REFERENCES `ss13_api_commands` (`id`) ON UPDATE CASCADE ON DELETE CASCADE,
CONSTRAINT `token_id` FOREIGN KEY (`token_id`) REFERENCES `ss13_api_tokens` (`id`) ON UPDATE CASCADE ON DELETE CASCADE
)
COLLATE='utf8_bin'
ENGINE=InnoDB;
`command_id` int(11) NOT NULL,
`token_id` int(11) NOT NULL,
PRIMARY KEY (`command_id`,`token_id`),
KEY `token_id` (`token_id`),
CONSTRAINT `function_id` FOREIGN KEY (`command_id`) REFERENCES `ss13_api_commands` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
CONSTRAINT `token_id` FOREIGN KEY (`token_id`) REFERENCES `ss13_api_tokens` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
--
-- Table for bans issued
--
CREATE TABLE `ss13_ban` (
`id` int(11) NOT NULL AUTO_INCREMENT,
@@ -78,13 +162,17 @@ CREATE TABLE `ss13_ban` (
`edits` text CHARACTER SET latin1,
`unbanned` tinyint(1) DEFAULT NULL,
`unbanned_datetime` datetime DEFAULT NULL,
`unbanned_reason` text CHARACTER SET latin1 DEFAULT NULL,
`unbanned_reason` text,
`unbanned_ckey` varchar(32) CHARACTER SET latin1 DEFAULT NULL,
`unbanned_computerid` varchar(32) CHARACTER SET latin1 DEFAULT NULL,
`unbanned_ip` varchar(32) CHARACTER SET latin1 DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
--
-- Table for ban-mirroring, used to catch ban dodgers
--
CREATE TABLE `ss13_ban_mirrors` (
`ban_mirror_id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`ban_id` int(10) unsigned NOT NULL,
@@ -95,6 +183,24 @@ CREATE TABLE `ss13_ban_mirrors` (
PRIMARY KEY (`ban_mirror_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
--
-- Table for housing CCIA notices to be sent mid-round
--
CREATE TABLE `ss13_ccia_general_notice_list` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`title` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`message` text COLLATE utf8_unicode_ci NOT NULL,
`deleted_at` timestamp NULL DEFAULT NULL,
`created_at` timestamp NULL DEFAULT NULL,
`updated_at` timestamp NULL DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
--
-- Table for player information
--
CREATE TABLE `ss13_player` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`ckey` varchar(32) CHARACTER SET latin1 NOT NULL,
@@ -109,95 +215,237 @@ CREATE TABLE `ss13_player` (
UNIQUE KEY `ckey` (`ckey`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
--
-- Table for linking requests between the Web-Interface and game server
--
CREATE TABLE `ss13_player_linking` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`forum_id` int(11) NOT NULL,
`forum_username_short` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`forum_username` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`player_ckey` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`status` enum('new','confirmed','rejected','linked') COLLATE utf8_unicode_ci NOT NULL,
`created_at` timestamp NULL DEFAULT NULL,
`updated_at` timestamp NULL DEFAULT NULL,
`deleted_at` timestamp NULL DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
--
-- Table for player personal-AI preferences
--
CREATE TABLE `ss13_player_pai` (
`ckey` varchar(32) NOT NULL,
`name` varchar(50) DEFAULT NULL,
`description` text,
`role` text,
`comments` text,
PRIMARY KEY (`ckey`),
CONSTRAINT `player_pai_fk_ckey` FOREIGN KEY (`ckey`) REFERENCES `ss13_player` (`ckey`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Table for general player preferences
--
CREATE TABLE `ss13_player_preferences` (
`ckey` varchar(32) NOT NULL,
`ooccolor` text,
`lastchangelog` text,
`UI_style` text,
`current_character` int(11) DEFAULT '0',
`toggles` int(11) DEFAULT '0',
`UI_style_color` text,
`UI_style_alpha` int(11) DEFAULT '255',
`asfx_togs` int(11) DEFAULT '0',
`lastmotd` text,
`lastmemo` text,
`language_prefixes` text,
PRIMARY KEY (`ckey`),
CONSTRAINT `player_preferences_fk_ckey` FOREIGN KEY (`ckey`) REFERENCES `ss13_player` (`ckey`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Table for holding admin ranks
--
CREATE TABLE `ss13_admin` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`ckey` varchar(32) CHARACTER SET latin1 NOT NULL,
`rank` varchar(32) CHARACTER SET latin1 NOT NULL DEFAULT 'Administrator',
`level` int(2) NOT NULL DEFAULT '0',
`flags` int(16) NOT NULL DEFAULT '0',
`discord_id` varchar(45) NOT NULL DEFAULT '',
PRIMARY KEY (`id`),
UNIQUE KEY `UNIQUE` (`ckey`),
CONSTRAINT `ckey` FOREIGN KEY (`ckey`) REFERENCES `ss13_player` (`ckey`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
--
-- Table for initial character data
--
CREATE TABLE `ss13_characters` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`ckey` varchar(32) NOT NULL,
`name` varchar(128) NULL DEFAULT NULL,
`metadata` varchar(512) NULL DEFAULT NULL,
`be_special_role` text NULL DEFAULT NULL,
`gender` varchar(32) NULL DEFAULT NULL,
`age` int(11) NULL DEFAULT NULL,
`species` varchar(32) NULL DEFAULT NULL,
`language` text NULL DEFAULT NULL,
`hair_colour` varchar(7) NULL DEFAULT NULL,
`facial_colour` varchar(7) NULL DEFAULT NULL,
`skin_tone` int(11) NULL DEFAULT NULL,
`skin_colour` varchar(7) NULL DEFAULT NULL,
`hair_style` varchar(32) NULL DEFAULT NULL,
`facial_style` varchar(32) NULL DEFAULT NULL,
`eyes_colour` varchar(7) NULL DEFAULT NULL,
`underwear` varchar(32) NULL DEFAULT NULL,
`undershirt` varchar(32) NULL DEFAULT NULL,
`socks` varchar(32) NULL DEFAULT NULL,
`backbag` int(11) NULL DEFAULT NULL,
`b_type` varchar(32) NULL DEFAULT NULL,
`spawnpoint` varchar(32) NULL DEFAULT NULL,
`jobs` text NULL DEFAULT NULL,
`name` varchar(128) DEFAULT NULL,
`metadata` varchar(512) DEFAULT NULL,
`be_special_role` text,
`gender` varchar(32) DEFAULT NULL,
`age` int(11) DEFAULT NULL,
`species` varchar(32) DEFAULT NULL,
`language` varchar(50) DEFAULT NULL,
`hair_colour` varchar(7) DEFAULT NULL,
`facial_colour` varchar(7) DEFAULT NULL,
`skin_tone` int(11) DEFAULT NULL,
`skin_colour` varchar(7) DEFAULT NULL,
`hair_style` varchar(32) DEFAULT NULL,
`facial_style` varchar(32) DEFAULT NULL,
`eyes_colour` varchar(7) DEFAULT NULL,
`underwear` varchar(32) DEFAULT NULL,
`undershirt` varchar(32) DEFAULT NULL,
`socks` varchar(32) DEFAULT NULL,
`backbag` int(11) DEFAULT NULL,
`b_type` varchar(32) DEFAULT NULL,
`spawnpoint` varchar(32) DEFAULT NULL,
`jobs` text,
`alternate_option` tinyint(1) DEFAULT NULL,
`alternate_titles` text NULL DEFAULT NULL,
`alternate_titles` text,
`disabilities` int(11) DEFAULT '0',
`skills` text NULL DEFAULT NULL,
`skill_specialization` text NULL DEFAULT NULL,
`home_system` text NULL DEFAULT NULL,
`citizenship` text NULL DEFAULT NULL,
`faction` text NULL DEFAULT NULL,
`religion` text NULL DEFAULT NULL,
`nt_relation` text NULL DEFAULT NULL,
`uplink_location` text NULL DEFAULT NULL,
`organs_data` text NULL DEFAULT NULL,
`organs_robotic` text NULL DEFAULT NULL,
`gear` text NULL DEFAULT NULL,
`skills` text,
`skill_specialization` text,
`home_system` text,
`citizenship` text,
`faction` text,
`religion` text,
`nt_relation` text,
`uplink_location` text,
`organs_data` text,
`organs_robotic` text,
`gear` text,
`created_at` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
`deleted_at` datetime NULL DEFAULT NULL,
`deleted_at` datetime DEFAULT NULL,
PRIMARY KEY (`id`),
KEY `ss13_characters_ckey` (`ckey`),
KEY `ss13_characteres_name` (`name`),
CONSTRAINT `ss13_characters_fk_ckey` FOREIGN KEY (`ckey`) REFERENCES `ss13_player` (`ckey`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Table for character flavour text
--
CREATE TABLE `ss13_characters_flavour` (
`char_id` int(11) NOT NULL,
`records_employment` text NULL DEFAULT NULL,
`records_medical` text NULL DEFAULT NULL,
`records_security` text NULL DEFAULT NULL,
`records_exploit` text NULL DEFAULT NULL,
`records_ccia` text NULL DEFAULT NULL,
`flavour_general` text NULL DEFAULT NULL,
`flavour_head` text NULL DEFAULT NULL,
`flavour_face` text NULL DEFAULT NULL,
`flavour_eyes` text NULL DEFAULT NULL,
`flavour_torso` text NULL DEFAULT NULL,
`flavour_arms` text NULL DEFAULT NULL,
`flavour_hands` text NULL DEFAULT NULL,
`flavour_legs` text NULL DEFAULT NULL,
`flavour_feet` text NULL DEFAULT NULL,
`robot_default` text NULL DEFAULT NULL,
`robot_standard` text NULL DEFAULT NULL,
`robot_engineering` text NULL DEFAULT NULL,
`robot_construction` text NULL DEFAULT NULL,
`robot_medical` text NULL DEFAULT NULL,
`robot_rescue` text NULL DEFAULT NULL,
`robot_miner` text NULL DEFAULT NULL,
`robot_custodial` text NULL DEFAULT NULL,
`robot_service` text NULL DEFAULT NULL,
`robot_clerical` text NULL DEFAULT NULL,
`robot_security` text NULL DEFAULT NULL,
`robot_research` text NULL DEFAULT NULL,
`records_employment` text,
`records_medical` text,
`records_security` text,
`records_exploit` text,
`records_ccia` text,
`flavour_general` text,
`flavour_head` text,
`flavour_face` text,
`flavour_eyes` text,
`flavour_torso` text,
`flavour_arms` text,
`flavour_hands` text,
`flavour_legs` text,
`flavour_feet` text,
`robot_default` text,
`robot_standard` text,
`robot_engineering` text,
`robot_construction` text,
`robot_medical` text,
`robot_rescue` text,
`robot_miner` text,
`robot_custodial` text,
`robot_service` text,
`robot_clerical` text,
`robot_security` text,
`robot_research` text,
PRIMARY KEY (`char_id`),
CONSTRAINT `ss13_flavour_fk_char_id` FOREIGN KEY (`char_id`) REFERENCES `ss13_characters` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=latin1 ROW_FORMAT=COMPACT;
--
-- Table for housing IC criminal records
--
CREATE TABLE `ss13_character_incidents` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`char_id` int(11) NOT NULL,
`UID` varchar(32) COLLATE utf8_bin NOT NULL,
`datetime` varchar(50) COLLATE utf8_bin NOT NULL,
`notes` text COLLATE utf8_bin NOT NULL,
`charges` text COLLATE utf8_bin NOT NULL,
`evidence` text COLLATE utf8_bin NOT NULL,
`arbiters` text COLLATE utf8_bin NOT NULL,
`brig_sentence` int(11) NOT NULL DEFAULT '0',
`fine` int(11) NOT NULL DEFAULT '0',
`felony` int(11) NOT NULL DEFAULT '0',
`created_by` varchar(50) COLLATE utf8_bin DEFAULT NULL,
`deleted_by` varchar(50) COLLATE utf8_bin DEFAULT NULL,
`game_id` varchar(50) COLLATE utf8_bin NOT NULL,
`created_at` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
`updated_at` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
`deleted_at` datetime DEFAULT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `UID_char_id` (`char_id`,`UID`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
--
-- Table for logging which characters have joined rounds when
--
CREATE TABLE `ss13_characters_log` (
`id` INT(11) UNSIGNED NOT NULL AUTO_INCREMENT,
`char_id` INT(11) NOT NULL,
`game_id` VARCHAR(50) NOT NULL,
`datetime` DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
`job_name` VARCHAR(32) NOT NULL,
`special_role` VARCHAR(32) NULL DEFAULT NULL,
PRIMARY KEY (`id`),
CONSTRAINT `ss13_charlog_fk_char_id` FOREIGN KEY (`char_id`) REFERENCES `ss13_characters` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
`id` int(11) unsigned NOT NULL AUTO_INCREMENT,
`char_id` int(11) NOT NULL,
`game_id` varchar(50) NOT NULL,
`datetime` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
`job_name` varchar(32) DEFAULT NULL,
`special_role` varchar(32) DEFAULT NULL,
PRIMARY KEY (`id`),
KEY `ss13_charlog_fk_char_id` (`char_id`),
CONSTRAINT `ss13_charlog_fk_char_id` FOREIGN KEY (`char_id`) REFERENCES `ss13_characters` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
--
-- Table for CCIA actions taken against characters
--
CREATE TABLE `ss13_ccia_actions` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`title` text COLLATE utf8_unicode_ci NOT NULL,
`type` enum('injunction','suspension','warning','other') COLLATE utf8_unicode_ci NOT NULL,
`issuedby` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`details` text COLLATE utf8_unicode_ci NOT NULL,
`url` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`expires_at` date DEFAULT NULL,
`deleted_at` timestamp NULL DEFAULT NULL,
`created_at` timestamp NULL DEFAULT NULL,
`updated_at` timestamp NULL DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
--
-- Bridge table between `ss13_ccia_actions` and `ss13_characters`
--
CREATE TABLE `ss13_ccia_action_char` (
`action_id` int(10) unsigned NOT NULL,
`char_id` int(11) NOT NULL,
PRIMARY KEY (`action_id`,`char_id`),
KEY `ccia_action_char_char_id_foreign` (`char_id`),
CONSTRAINT `ccia_action_char_action_id_foreign` FOREIGN KEY (`action_id`) REFERENCES `ss13_ccia_actions` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
CONSTRAINT `ccia_action_char_char_id_foreign` FOREIGN KEY (`char_id`) REFERENCES `ss13_characters` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
--
-- Table for logging player connections
--
CREATE TABLE `ss13_connection_log` (
`id` int(11) unsigned NOT NULL AUTO_INCREMENT,
`ckey` varchar(32) NOT NULL,
@@ -208,12 +456,20 @@ CREATE TABLE `ss13_connection_log` (
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
--
-- Table for antag contest participants
--
CREATE TABLE `ss13_contest_participants` (
`player_ckey` varchar(32) NOT NULL,
`character_id` int(10) unsigned NOT NULL,
`contest_faction` enum('INDEP','SLF','BIS','ASI','PSIS','HSH','TCD') NOT NULL DEFAULT 'INDEP'
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
--
-- Table for antag contenst reports
--
CREATE TABLE `ss13_contest_reports` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`player_ckey` varchar(32) NOT NULL,
@@ -223,17 +479,13 @@ CREATE TABLE `ss13_contest_reports` (
`objective_side` enum('pro_synth','anti_synth') NOT NULL,
`objective_outcome` tinyint(1) DEFAULT '0',
`objective_datetime` datetime NOT NULL,
`duplicate` int(1) unsigned DEFAULT '0',
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE `ss13_customitems` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`ckey` varchar(32) CHARACTER SET latin1 NOT NULL,
`real_name` varchar(32) CHARACTER SET latin1 NOT NULL,
`item` varchar(124) CHARACTER SET latin1 NOT NULL,
`job` text CHARACTER SET latin1,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
--
-- Table for death statistics
--
CREATE TABLE `ss13_death` (
`id` int(11) NOT NULL AUTO_INCREMENT,
@@ -254,6 +506,10 @@ CREATE TABLE `ss13_death` (
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
--
-- Table for housing station directives
--
CREATE TABLE `ss13_directives` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`name` varchar(64) CHARACTER SET latin1 NOT NULL,
@@ -261,6 +517,10 @@ CREATE TABLE `ss13_directives` (
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
--
-- Table for round statistics
--
CREATE TABLE `ss13_feedback` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`time` datetime NOT NULL,
@@ -271,6 +531,10 @@ CREATE TABLE `ss13_feedback` (
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
--
-- Table for ingame forms
--
CREATE TABLE `ss13_forms` (
`form_id` int(11) NOT NULL AUTO_INCREMENT,
`id` varchar(4) CHARACTER SET latin1 NOT NULL,
@@ -281,6 +545,22 @@ CREATE TABLE `ss13_forms` (
PRIMARY KEY (`form_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
--
-- Table for tracking IPC implants
--
CREATE TABLE `ss13_ipc_tracking` (
`id` int(11) unsigned NOT NULL AUTO_INCREMENT,
`player_ckey` varchar(32) NOT NULL,
`character_name` varchar(255) NOT NULL,
`tag_status` tinyint(1) NOT NULL DEFAULT '0',
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Table for the ingame library
--
CREATE TABLE `ss13_library` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`author` text CHARACTER SET latin1 NOT NULL,
@@ -292,21 +572,9 @@ CREATE TABLE `ss13_library` (
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE `ss13_news` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`publishtime` int(11) NOT NULL,
`channel` varchar(64) CHARACTER SET latin1 NOT NULL,
`author` varchar(64) CHARACTER SET latin1 NOT NULL,
`title` varchar(64) CHARACTER SET latin1 DEFAULT NULL,
`body` text CHARACTER SET latin1 NOT NULL,
`notpublishing` tinyint(1) DEFAULT '0',
`approved` tinyint(1) DEFAULT '0',
`status` tinyint(1) NOT NULL DEFAULT '1',
`uploadip` varchar(18) CHARACTER SET latin1 NOT NULL,
`uploadtime` datetime NOT NULL,
`approvetime` datetime DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
--
-- Table for player notes
--
CREATE TABLE `ss13_notes` (
`id` int(11) NOT NULL AUTO_INCREMENT,
@@ -323,37 +591,9 @@ CREATE TABLE `ss13_notes` (
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE `ss13_player_linking` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`forum_id` int(11) NOT NULL,
`forum_username_short` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`forum_username` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`player_ckey` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`status` enum('new','confirmed','rejected','linked') COLLATE utf8_unicode_ci NOT NULL,
`created_at` timestamp NULL DEFAULT NULL,
`updated_at` timestamp NULL DEFAULT NULL,
`deleted_at` timestamp NULL DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
CREATE TABLE `ss13_player_preferences` (
`ckey` varchar(32) NOT NULL,
`ooccolor` text NULL DEFAULT NULL,
`lastchangelog` text NULL DEFAULT NULL,
`UI_style` text NULL DEFAULT NULL,
`current_character` int(11) NULL DEFAULT NULL,
`toggles` int(11) DEFAULT '0',
`UI_style_color` text NULL DEFAULT NULL,
`UI_style_alpha` int(11) NULL DEFAULT '255',
`asfx_togs` int(11) DEFAULT '0',
`lastmotd` text NULL DEFAULT NULL,
`lastmemo` text NULL DEFAULT NULL,
`language_prefixes` text NULL DEFAULT NULL,
`parallax_toggles` INT(11) NULL DEFAULT NULL,
`parallax_speed` INT(11) NULL DEFAULT NULL,
PRIMARY KEY (`ckey`),
CONSTRAINT `player_preferences_fk_ckey` FOREIGN KEY (`ckey`) REFERENCES `ss13_player` (`ckey`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Table for ingame poll options
--
CREATE TABLE `ss13_poll_option` (
`id` int(11) NOT NULL AUTO_INCREMENT,
@@ -368,6 +608,10 @@ CREATE TABLE `ss13_poll_option` (
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
--
-- Table for ingame poll questions
--
CREATE TABLE `ss13_poll_question` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`polltype` varchar(16) CHARACTER SET latin1 NOT NULL DEFAULT 'OPTION',
@@ -379,6 +623,10 @@ CREATE TABLE `ss13_poll_question` (
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
--
-- Table for ingame poll text/freeform replies
--
CREATE TABLE `ss13_poll_textreply` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`datetime` datetime NOT NULL,
@@ -390,6 +638,10 @@ CREATE TABLE `ss13_poll_textreply` (
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
--
-- Table for ingame poll votes
--
CREATE TABLE `ss13_poll_vote` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`datetime` datetime NOT NULL,
@@ -402,13 +654,21 @@ CREATE TABLE `ss13_poll_vote` (
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
--
-- Table for tracking ingame population counts
--
CREATE TABLE `ss13_population` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`playercount` int(11) DEFAULT NULL,
`admincount` int(11) DEFAULT NULL,
`time` datetime NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=69279 DEFAULT CHARSET=utf8;
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
--
-- Table for player privacy preferences
--
CREATE TABLE `ss13_privacy` (
`id` int(11) NOT NULL AUTO_INCREMENT,
@@ -418,6 +678,27 @@ CREATE TABLE `ss13_privacy` (
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
--
-- Table for ingame santa clause event
--
CREATE TABLE `ss13_santa` (
`character_name` varchar(32) NOT NULL,
`participation_status` tinyint(1) NOT NULL DEFAULT '1',
`is_assigned` tinyint(1) NOT NULL DEFAULT '0',
`mark_name` varchar(32) DEFAULT NULL,
`character_gender` varchar(32) NOT NULL,
`character_species` varchar(32) NOT NULL,
`character_job` varchar(32) NOT NULL,
`character_like` mediumtext NOT NULL,
`gift_assigned` varchar(255) DEFAULT NULL,
PRIMARY KEY (`character_name`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Table for syndicate contracts
--
CREATE TABLE `ss13_syndie_contracts` (
`contract_id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`contractee_id` int(11) NOT NULL,
@@ -435,10 +716,14 @@ CREATE TABLE `ss13_syndie_contracts` (
PRIMARY KEY (`contract_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
--
-- Table for comments to syndicate contracts
--
CREATE TABLE `ss13_syndie_contracts_comments` (
`comment_id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`contract_id` int(11) NOT NULL,
`commentor_id` int(11) NOT NULL,
`contract_id` int(11) unsigned NOT NULL,
`commentor_id` int(11) unsigned NOT NULL,
`commentor_name` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`title` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`comment` text COLLATE utf8_unicode_ci NOT NULL,
@@ -447,9 +732,62 @@ CREATE TABLE `ss13_syndie_contracts_comments` (
`created_at` timestamp NULL DEFAULT NULL,
`updated_at` timestamp NULL DEFAULT NULL,
`deleted_at` timestamp NULL DEFAULT NULL,
PRIMARY KEY (`comment_id`)
`report_status` enum('waiting-approval','accepted','rejected') COLLATE utf8_unicode_ci DEFAULT NULL,
PRIMARY KEY (`comment_id`),
KEY `contract_id` (`contract_id`),
CONSTRAINT `contract_id` FOREIGN KEY (`contract_id`) REFERENCES `ss13_syndie_contracts` (`contract_id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
--
-- Bridge table between contract comment data and player table
--
CREATE TABLE `ss13_syndie_contracts_comments_completers` (
`user_id` int(11) NOT NULL,
`comment_id` int(10) unsigned NOT NULL,
PRIMARY KEY (`user_id`,`comment_id`),
KEY `comment_id` (`comment_id`),
CONSTRAINT `comment_id` FOREIGN KEY (`comment_id`) REFERENCES `ss13_syndie_contracts_comments` (`comment_id`) ON DELETE CASCADE,
CONSTRAINT `user_id` FOREIGN KEY (`user_id`) REFERENCES `ss13_player` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
--
-- Table for individual contract objectives
--
CREATE TABLE `ss13_syndie_contracts_objectives` (
`objective_id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`contract_id` int(11) NOT NULL,
`status` enum('open','closed','deleted') COLLATE utf8_unicode_ci NOT NULL,
`title` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`description` text COLLATE utf8_unicode_ci NOT NULL,
`reward_credits` int(11) DEFAULT NULL,
`reward_credits_update` int(11) DEFAULT NULL,
`reward_other` text COLLATE utf8_unicode_ci,
`reward_other_update` text COLLATE utf8_unicode_ci,
`created_at` timestamp NULL DEFAULT NULL,
`updated_at` timestamp NULL DEFAULT NULL,
`deleted_at` timestamp NULL DEFAULT NULL,
PRIMARY KEY (`objective_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
--
-- Bridge table between contract objectives and comments
--
CREATE TABLE `ss13_syndie_contracts_comments_objectives` (
`objective_id` int(10) unsigned NOT NULL,
`comment_id` int(10) unsigned NOT NULL,
PRIMARY KEY (`objective_id`,`comment_id`),
KEY `comments_comment_id` (`comment_id`),
CONSTRAINT `comments_comment_id` FOREIGN KEY (`comment_id`) REFERENCES `ss13_syndie_contracts_comments` (`comment_id`) ON DELETE CASCADE,
CONSTRAINT `objectives_objective_id` FOREIGN KEY (`objective_id`) REFERENCES `ss13_syndie_contracts_objectives` (`objective_id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
--
-- Table for contract subscribers
--
CREATE TABLE `ss13_syndie_contracts_subscribers` (
`contract_id` int(10) unsigned NOT NULL,
`user_id` int(10) unsigned NOT NULL,
@@ -457,6 +795,10 @@ CREATE TABLE `ss13_syndie_contracts_subscribers` (
CONSTRAINT `syndie_contracts_subscribers_contract_id_foreign` FOREIGN KEY (`contract_id`) REFERENCES `ss13_syndie_contracts` (`contract_id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
--
-- Table for player warnings
--
CREATE TABLE `ss13_warnings` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`time` datetime NOT NULL,
@@ -478,6 +820,10 @@ CREATE TABLE `ss13_warnings` (
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
--
-- Table for housing tokens for the WebInterface SSO from within the game
--
CREATE TABLE `ss13_web_sso` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`ckey` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
@@ -487,6 +833,10 @@ CREATE TABLE `ss13_web_sso` (
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
--
-- Table for logging whitelist alterations
--
CREATE TABLE `ss13_whitelist_log` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`datetime` datetime NOT NULL,
@@ -496,93 +846,13 @@ CREATE TABLE `ss13_whitelist_log` (
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Table for storing whitelist bitkeys
--
CREATE TABLE `ss13_whitelist_statuses` (
`flag` int(10) unsigned NOT NULL,
`status_name` varchar(32) NOT NULL,
`subspecies` tinyint(4) NOT NULL DEFAULT '1',
PRIMARY KEY (`status_name`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
CREATE TABLE `ss13_stats_ie` (
`ckey` varchar(32) NOT NULL,
`IsIE` tinyint(4) NOT NULL,
`IsEdge` tinyint(4) NOT NULL,
`EdgeHtmlVersion` int(11) NOT NULL,
`TrueVersion` tinyint(4) NOT NULL,
`ActingVersion` tinyint(4) NOT NULL,
`CompatibilityMode` tinyint(4) NOT NULL,
`DateUpdated` datetime DEFAULT CURRENT_TIMESTAMP,
PRIMARY KEY (`ckey`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE `ss13_character_incidents` (
`id` INT(11) NOT NULL AUTO_INCREMENT,
`char_id` INT(11) NOT NULL,
`UID` VARCHAR(32) NOT NULL COLLATE 'utf8_bin',
`datetime` VARCHAR(50) NOT NULL COLLATE 'utf8_bin',
`notes` TEXT NOT NULL COLLATE 'utf8_bin',
`charges` TEXT NOT NULL COLLATE 'utf8_bin',
`evidence` TEXT NOT NULL COLLATE 'utf8_bin',
`arbiters` TEXT NOT NULL COLLATE 'utf8_bin',
`brig_sentence` INT(11) NOT NULL DEFAULT '0',
`fine` INT(11) NOT NULL DEFAULT '0',
`felony` INT(11) NOT NULL DEFAULT '0',
`created_by` VARCHAR(50) NULL DEFAULT NULL COLLATE 'utf8_bin',
`deleted_by` VARCHAR(50) NULL DEFAULT NULL COLLATE 'utf8_bin',
`game_id` VARCHAR(50) NOT NULL COLLATE 'utf8_bin',
`created_at` DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
`updated_at` DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
`deleted_at` DATETIME NULL DEFAULT NULL,
PRIMARY KEY (`id`),
UNIQUE INDEX `UID_char_id` (`char_id`, `UID`)
) COLLATE='utf8_bin' ENGINE=InnoDB;
CREATE TABLE `discord_channels` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`channel_group` varchar(32) NOT NULL,
`channel_id` text NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE `ss13_ccia_actions` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`title` text COLLATE utf8_unicode_ci NOT NULL,
`type` enum('injunction','suspension','warning','other') COLLATE utf8_unicode_ci NOT NULL,
`issuedby` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`details` text COLLATE utf8_unicode_ci NOT NULL,
`url` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`expires_at` date DEFAULT NULL,
`deleted_at` timestamp NULL DEFAULT NULL,
`created_at` timestamp NULL DEFAULT NULL,
`updated_at` timestamp NULL DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
CREATE TABLE `ss13_ccia_action_char` (
`action_id` int(10) unsigned NOT NULL,
`char_id` int(11) NOT NULL,
PRIMARY KEY (`action_id`,`char_id`),
KEY `ccia_action_char_char_id_foreign` (`char_id`),
CONSTRAINT `ccia_action_char_action_id_foreign` FOREIGN KEY (`action_id`) REFERENCES `ss13_ccia_actions` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
CONSTRAINT `ccia_action_char_char_id_foreign` FOREIGN KEY (`char_id`) REFERENCES `ss13_characters` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
CREATE TABLE `ss13_ccia_general_notice_list` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`title` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`message` text COLLATE utf8_unicode_ci NOT NULL,
`deleted_at` timestamp NULL DEFAULT NULL,
`created_at` timestamp NULL DEFAULT NULL,
`updated_at` timestamp NULL DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
CREATE TABLE `ss13_player_pai` (
`ckey` VARCHAR(32) NOT NULL,
`name` VARCHAR(50) NULL DEFAULT NULL,
`description` TEXT NULL DEFAULT NULL,
`role` TEXT NULL DEFAULT NULL,
`comments` TEXT NULL DEFAULT NULL,
PRIMARY KEY (`ckey`),
CONSTRAINT `player_pai_fk_ckey` FOREIGN KEY (`ckey`) REFERENCES `ss13_player` (`ckey`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
@@ -0,0 +1,7 @@
--
-- Adds parallax related preferences toggles for the player preferences table.
--
ALTER TABLE `ss13_player_preferences`
ADD `parallax_toggles` INT(11) NULL DEFAULT NULL,
ADD `parallax_speed` INT(11) NULL DEFAULT NULL;
+6
View File
@@ -0,0 +1,6 @@
flyway.locations=filesystem:sql/migrate
# copy these into another file and use the -configFile switch on flyway
# flyway.url=jdbc:mysql://localhost/bs12
# flyway.user=
# flyway.password=