mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-08-22 12:41:09 +01:00
* ezdb - A one click script to quickly setting up a development database (#75053) https://user-images.githubusercontent.com/35135081/235344815-8e825ba9-52cf-44e8-b8e2-a2aeb5d47276.mp4 - Downloads a portable MariaDB (doesn't pollute your main system) - Sets up a database with a random password on port 1338 (configurable) - Installs the initial schema - Every time after, will run updates Major versions right now explicitly escape hatch, because those historically come with something like a Python script, and I do not want it to pretend to work. --------- Co-authored-by: san7890 <the@san7890.com> * touchups * oh well --------- Co-authored-by: Mothblocks <35135081+Mothblocks@users.noreply.github.com> Co-authored-by: san7890 <the@san7890.com> Co-authored-by: Useroth <37159550+Useroth@users.noreply.github.com>
This commit is contained in:
co-authored by
san7890
Mothblocks
Useroth
parent
8f9fd2893a
commit
d91555b79e
@@ -2,19 +2,21 @@ Any time you make a change to the schema files, remember to increment the databa
|
||||
|
||||
Make sure to also update `DB_MAJOR_VERSION` and `DB_MINOR_VERSION`, which can be found in `code/__DEFINES/subsystem.dm`.
|
||||
|
||||
The latest database version is 5.25 (5.23 for /tg/); The query to update the schema revision table is:
|
||||
The latest database version is 5.26 (5.24 for /tg/); The query to update the schema revision table is:
|
||||
|
||||
INSERT INTO `schema_revision` (`major`, `minor`) VALUES (5, 25);
|
||||
```sql
|
||||
INSERT INTO `schema_revision` (`major`, `minor`) VALUES (5, 26);
|
||||
```
|
||||
or
|
||||
INSERT INTO `SS13_schema_revision` (`major`, `minor`) VALUES (5, 25);
|
||||
|
||||
```sql
|
||||
INSERT INTO `SS13_schema_revision` (`major`, `minor`) VALUES (5, 26);
|
||||
```
|
||||
|
||||
In any query remember to add a prefix to the table names if you use one.
|
||||
|
||||
-----------------------------------------------------
|
||||
<<<<<<< HEAD:SQL/database_changelog.txt
|
||||
Version 5.25, 28 December 2022, by Mothblocks
|
||||
=======
|
||||
Version 5.24, 17 May 2023, by LemonInTheDark
|
||||
Version 5.26, 17 May 2023, by LemonInTheDark
|
||||
Modified the library action table to fit ckeys properly, and to properly store ips.
|
||||
```sql
|
||||
ALTER TABLE `library_action` MODIFY COLUMN `ckey` varchar(32) NOT NULL;
|
||||
@@ -22,11 +24,10 @@ Modified the library action table to fit ckeys properly, and to properly store i
|
||||
```
|
||||
|
||||
-----------------------------------------------------
|
||||
Version 5.23, 28 December 2022, by Mothblocks
|
||||
>>>>>>> 0065f020ed2 (Removes line about adding a new index to the library_action table (#75808)):SQL/database_changelog.md
|
||||
Version 5.25, 28 December 2022, by Mothblocks
|
||||
Added `tutorial_completions` to mark what ckeys have completed contextual tutorials.
|
||||
|
||||
```
|
||||
```sql
|
||||
CREATE TABLE `tutorial_completions` (
|
||||
`id` INT NOT NULL AUTO_INCREMENT,
|
||||
`ckey` VARCHAR(32) NOT NULL,
|
||||
@@ -39,15 +40,15 @@ CREATE TABLE `tutorial_completions` (
|
||||
Version 5.24, 22 December 2021, by Mothblocks
|
||||
Fixes a bug in `telemetry_connections` that limited the range of IPs.
|
||||
|
||||
```
|
||||
```sql
|
||||
ALTER TABLE `telemetry_connections` MODIFY COLUMN `address` INT(10) UNSIGNED NOT NULL;
|
||||
```
|
||||
|
||||
-----------------------------------------------------
|
||||
|
||||
Version 5.23, 15 December 2021, by Mothblocks
|
||||
Adds `telemetry_connections` table for tracking tgui telemetry.
|
||||
|
||||
```
|
||||
```sql
|
||||
CREATE TABLE `telemetry_connections` (
|
||||
`id` INT NOT NULL AUTO_INCREMENT,
|
||||
`ckey` VARCHAR(32) NOT NULL,
|
||||
@@ -65,17 +66,16 @@ CREATE TABLE `telemetry_connections` (
|
||||
Version 5.22, 11 November 2021, by Mothblocks
|
||||
Adds `admin_ckey` field to the `known_alts` table to track who added what.
|
||||
|
||||
```
|
||||
```sql
|
||||
ALTER TABLE `known_alts`
|
||||
ADD COLUMN `admin_ckey` VARCHAR(32) NOT NULL DEFAULT '*no key*' AFTER `ckey2`;
|
||||
```
|
||||
|
||||
-----------------------------------------------------
|
||||
|
||||
Version 5.21, 10 November 2021, by WalterMeldron
|
||||
Adds an urgent column to tickets for ahelps marked as urgent.
|
||||
|
||||
```
|
||||
```sql
|
||||
ALTER TABLE `ticket` ADD COLUMN `urgent` TINYINT(1) UNSIGNED NOT NULL DEFAULT '0' AFTER `sender`;
|
||||
```
|
||||
|
||||
@@ -83,7 +83,7 @@ ALTER TABLE `ticket` ADD COLUMN `urgent` TINYINT(1) UNSIGNED NOT NULL DEFAULT '0
|
||||
Version 5.20, 1 November 2021, by Mothblocks
|
||||
Added `known_alts` table for tracking who not to create suspicious logins for.
|
||||
|
||||
```
|
||||
```sql
|
||||
CREATE TABLE `known_alts` (
|
||||
`id` INT NOT NULL AUTO_INCREMENT,
|
||||
`ckey1` VARCHAR(32) NOT NULL,
|
||||
@@ -94,18 +94,10 @@ CREATE TABLE `known_alts` (
|
||||
```
|
||||
|
||||
-----------------------------------------------------
|
||||
Version 5.19, 23 August 2021, by GoldenAlpharex
|
||||
Added `discord_report` column to the `ban table`
|
||||
|
||||
```
|
||||
`discord_reported` TINYINT(1) UNSIGNED NOT NULL DEFAULT '0', /* SKYRAT EDIT - Labelling bans for ease of reporting them over Discord. */
|
||||
```
|
||||
|
||||
-----------------------------------------------------
|
||||
Version 5.18, 8 October 2021, by MrStonedOne + Mothblocks
|
||||
Version 5.19, 8 October 2021, by MrStonedOne + Mothblocks
|
||||
Changes any table that requrired a NOT NULL round ID to now accept NULL. In the BSQL past, these were handled as 0, but in the move to rust-g this behavior was lost.
|
||||
|
||||
```
|
||||
```sql
|
||||
ALTER TABLE `admin_log` CHANGE `round_id` `round_id` INT(11) UNSIGNED NULL;
|
||||
ALTER TABLE `ban` CHANGE `round_id` `round_id` INT(11) UNSIGNED NULL;
|
||||
ALTER TABLE `citation` CHANGE `round_id` `round_id` INT(11) UNSIGNED NULL;
|
||||
@@ -120,11 +112,19 @@ ALTER TABLE `player` CHANGE `lastseen_round_id` `lastseen_round_id` INT(11) UNSI
|
||||
ALTER TABLE `ticket` CHANGE `round_id` `round_id` INT(11) UNSIGNED NULL;
|
||||
```
|
||||
|
||||
-----------------------------------------------------
|
||||
Version 5.18, 23 August 2021, by GoldenAlpharex
|
||||
Added `discord_report` column to the `ban table`
|
||||
|
||||
```sql
|
||||
`discord_reported` TINYINT(1) UNSIGNED NOT NULL DEFAULT '0', /* SKYRAT EDIT - Labelling bans for ease of reporting them over Discord. */
|
||||
```
|
||||
|
||||
-----------------------------------------------------
|
||||
Version 5.17, 31 July 2021, by Atlanta-Ned
|
||||
Added `library_action` table for tracking reported library books and actions taken on them.
|
||||
|
||||
```
|
||||
```sql
|
||||
DROP TABLE IF EXISTS `library_action`;
|
||||
CREATE TABLE `library_action` (
|
||||
`id` int(11) unsigned NOT NULL AUTO_INCREMENT,
|
||||
@@ -143,7 +143,7 @@ CREATE TABLE `library_action` (
|
||||
Version 5.16, 2 June 2021, by Mothblocks
|
||||
Added verified admin connection log used for 2FA
|
||||
|
||||
```
|
||||
```sql
|
||||
DROP TABLE IF EXISTS `admin_connections`;
|
||||
CREATE TABLE `admin_connections` (
|
||||
`id` INT NOT NULL AUTO_INCREMENT,
|
||||
@@ -157,9 +157,10 @@ CREATE TABLE `admin_connections` (
|
||||
|
||||
-----------------------------------------------------
|
||||
|
||||
Version 5.15, 24 May 2021, by Anturke
|
||||
Version 5.15, xx May 2021, by Anturke
|
||||
Added exploration drone adventure table
|
||||
|
||||
```sql
|
||||
DROP TABLE IF EXISTS `text_adventures`;
|
||||
CREATE TABLE `text_adventures` (
|
||||
`id` int(11) NOT NULL AUTO_INCREMENT,
|
||||
@@ -169,12 +170,14 @@ CREATE TABLE `text_adventures` (
|
||||
`approved` TINYINT(1) NOT NULL DEFAULT FALSE,
|
||||
PRIMARY KEY (`id`)
|
||||
) ENGINE=InnoDB;
|
||||
```
|
||||
|
||||
-----------------------------------------------------
|
||||
|
||||
Version 5.14, 30 April 2021, by Atlanta Ned
|
||||
Added the `citation` table for tracking security citations in the database.
|
||||
|
||||
```sql
|
||||
CREATE TABLE `citation` (
|
||||
`id` INT(10) UNSIGNED NOT NULL AUTO_INCREMENT,
|
||||
`round_id` INT(11) UNSIGNED NOT NULL,
|
||||
@@ -196,6 +199,7 @@ COLLATE='utf8mb4_general_ci'
|
||||
ENGINE=InnoDB
|
||||
AUTO_INCREMENT=1
|
||||
;
|
||||
```
|
||||
|
||||
-----------------------------------------------------
|
||||
|
||||
@@ -206,6 +210,7 @@ between servers when it comes to bans, statistical data, etc.
|
||||
|
||||
You might also want to update the server_name column in older records in the tables, however it is not absolutely necessary.
|
||||
|
||||
```sql
|
||||
ALTER TABLE `ban`
|
||||
ADD COLUMN `server_name` VARCHAR(32) DEFAULT NULL AFTER `bantime`,
|
||||
ADD COLUMN `global_ban` TINYINT(1) UNSIGNED NOT NULL DEFAULT '1' AFTER `role`;
|
||||
@@ -227,6 +232,7 @@ ALTER TABLE `messages`
|
||||
|
||||
ALTER TABLE `round`
|
||||
ADD COLUMN `server_name` VARCHAR(32) DEFAULT NULL AFTER `end_datetime`;
|
||||
```
|
||||
|
||||
|
||||
-----------------------------------------------------
|
||||
@@ -234,7 +240,9 @@ ALTER TABLE `round`
|
||||
Version 5.12, 29 December 2020, by Missfox
|
||||
Modified table `messages`, adding column `playtime` to show the user's playtime when the note was created.
|
||||
|
||||
```sql
|
||||
ALTER TABLE `messages` ADD `playtime` INT(11) NULL DEFAULT(NULL) AFTER `severity`
|
||||
```
|
||||
|
||||
-----------------------------------------------------
|
||||
|
||||
@@ -242,11 +250,13 @@ Version 5.11, 7 September 2020, by bobbahbrown, MrStonedOne, and Jordie0608 (Upd
|
||||
|
||||
Adds indices to support search operations on the adminhelp ticket tables. This is to support improved performance on Atlanta Ned's Statbus.
|
||||
|
||||
```sql
|
||||
ALTER TABLE `ticket`
|
||||
ADD INDEX `idx_ticket_act_recip` (`action`, `recipient`),
|
||||
ADD INDEX `idx_ticket_act_send` (`action`, `sender`),
|
||||
ADD INDEX `idx_ticket_tic_rid` (`ticket`, `round_id`),
|
||||
ADD INDEX `idx_ticket_act_time_rid` (`action`, `timestamp`, `round_id`);
|
||||
```
|
||||
|
||||
-----------------------------------------------------
|
||||
|
||||
@@ -256,6 +266,7 @@ Changes how the discord verification process works.
|
||||
Adds the discord_links table, and migrates discord id entries from player table to the discord links table in a once off operation and then removes the discord id
|
||||
on the player table
|
||||
|
||||
```sql
|
||||
START TRANSACTION;
|
||||
|
||||
DROP TABLE IF EXISTS `discord_links`;
|
||||
@@ -274,6 +285,7 @@ INSERT INTO `discord_links` (`ckey`, `discord_id`, `one_time_token`, `valid`) SE
|
||||
ALTER TABLE `player` DROP COLUMN `discord_id`;
|
||||
|
||||
COMMIT;
|
||||
```
|
||||
|
||||
-----------------------------------------------------
|
||||
|
||||
@@ -283,6 +295,7 @@ Added the `deleted` column to tables 'poll_option', 'poll_textreply' and 'poll_v
|
||||
Changes table 'poll_question' column `createdby_ckey` to be NOT NULL and index `idx_pquest_time_admin` to be `idx_pquest_time_deleted_id` and 'poll_textreply' column `adminrank` to have no default.
|
||||
Added procedure `set_poll_deleted` that's called when deleting a poll to set deleted to true on each poll table where rows matching a poll_id argument.
|
||||
|
||||
```sql
|
||||
ALTER TABLE `poll_option`
|
||||
ADD COLUMN `deleted` TINYINT(1) UNSIGNED NOT NULL DEFAULT '0' AFTER `default_percentage_calc`;
|
||||
|
||||
@@ -315,19 +328,23 @@ UPDATE `poll_textreply` SET deleted = 1 WHERE pollid = poll_id;
|
||||
END
|
||||
$$
|
||||
DELIMITER ;
|
||||
```
|
||||
|
||||
-----------------------------------------------------
|
||||
|
||||
Version 5.8, 7 April 2020, by Jordie0608
|
||||
Modified table `messages`, adding column `deleted_ckey` to record who deleted a message.
|
||||
|
||||
```sql
|
||||
ALTER TABLE `messages` ADD COLUMN `deleted_ckey` VARCHAR(32) NULL DEFAULT NULL AFTER `deleted`;
|
||||
```
|
||||
|
||||
-----------------------------------------------------
|
||||
|
||||
Version 5.7, 10 January 2020 by Atlanta-Ned
|
||||
Added ticket table for tracking ahelp tickets in the database.
|
||||
|
||||
```sql
|
||||
DROP TABLE IF EXISTS `ticket`;
|
||||
CREATE TABLE `ticket` (
|
||||
`id` int(11) unsigned NOT NULL AUTO_INCREMENT,
|
||||
@@ -342,20 +359,23 @@ CREATE TABLE `ticket` (
|
||||
`sender` varchar(32) DEFAULT NULL,
|
||||
PRIMARY KEY (`id`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
|
||||
```
|
||||
|
||||
-----------------------------------------------------
|
||||
|
||||
Version 5.6, 6 December 2019 by Anturke
|
||||
Added achievement_name and achievement_description columns to achievement_metadata table.
|
||||
|
||||
|
||||
```sql
|
||||
ALTER TABLE `achievement_metadata` ADD COLUMN (`achievement_name` VARCHAR(64) NULL DEFAULT NULL, `achievement_description` VARCHAR(512) NULL DEFAULT NULL);
|
||||
```
|
||||
|
||||
-----------------------------------------------------
|
||||
|
||||
Version 5.5, 26 October 2019 by Anturke
|
||||
Added achievement_metadata table.
|
||||
|
||||
```sql
|
||||
DROP TABLE IF EXISTS `achievement_metadata`;
|
||||
CREATE TABLE `achievement_metadata` (
|
||||
`achievement_key` VARCHAR(32) NOT NULL,
|
||||
@@ -363,7 +383,7 @@ CREATE TABLE `achievement_metadata` (
|
||||
`achievement_type` enum('achievement','score','award') NULL DEFAULT NULL,
|
||||
PRIMARY KEY (`achievement_key`)
|
||||
) ENGINE=InnoDB;
|
||||
|
||||
```
|
||||
|
||||
-----------------------------------------------------
|
||||
|
||||
@@ -371,6 +391,7 @@ Version 5.4, 5 October 2019 by Anturke
|
||||
Added achievements table.
|
||||
See hub migration verb in _achievement_data.dm for details on migrating.
|
||||
|
||||
```sql
|
||||
CREATE TABLE `achievements` (
|
||||
`ckey` VARCHAR(32) NOT NULL,
|
||||
`achievement_key` VARCHAR(32) NOT NULL,
|
||||
@@ -378,26 +399,32 @@ CREATE TABLE `achievements` (
|
||||
`last_updated` DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
|
||||
PRIMARY KEY (`ckey`,`achievement_key`)
|
||||
) ENGINE=InnoDB;
|
||||
```
|
||||
|
||||
----------------------------------------------------
|
||||
|
||||
Version 5.3, 6 July 2019, by Atlanta-Ned
|
||||
Added a `feedback` column to the admin table, used for linking to individual admin feedback threads. Currently this is only used for statistics tracking tools such as Statbus and isn't used by the game.
|
||||
|
||||
```sql
|
||||
ALTER TABLE `admin` ADD `feedback` VARCHAR(255) NULL DEFAULT NULL AFTER `rank`;
|
||||
```
|
||||
|
||||
----------------------------------------------------
|
||||
|
||||
Version 5.2, 30 May 2019, by AffectedArc07
|
||||
Added a field to the `player` table to track ckey and discord ID relationships
|
||||
|
||||
```sql
|
||||
ALTER TABLE `player`
|
||||
ADD COLUMN `discord_id` BIGINT NULL DEFAULT NULL AFTER `flags`;
|
||||
```
|
||||
----------------------------------------------------
|
||||
|
||||
Version 5.1, 25 Feb 2018, by MrStonedOne
|
||||
Added four tables to enable storing of stickybans in the database since byond can lose them, and to enable disabling stickybans for a round without depending on a crash free round. Existing stickybans are automagically imported to the tables.
|
||||
|
||||
```sql
|
||||
CREATE TABLE `stickyban` (
|
||||
`ckey` VARCHAR(32) NOT NULL,
|
||||
`reason` VARCHAR(2048) NOT NULL,
|
||||
@@ -430,6 +457,7 @@ CREATE TABLE `stickyban_matched_cid` (
|
||||
`last_matched` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
|
||||
PRIMARY KEY (`stickyban`, `matched_cid`)
|
||||
) ENGINE=InnoDB;
|
||||
```
|
||||
|
||||
----------------------------------------------------
|
||||
|
||||
@@ -439,6 +467,8 @@ Modified ban table to remove the need for the `bantype` column, a python script
|
||||
See the file 'ban_conversion_2018-10-28.py' for instructions on how to use the script.
|
||||
|
||||
A new ban table can be created with the query:
|
||||
|
||||
```sql
|
||||
CREATE TABLE `ban` (
|
||||
`id` INT(11) UNSIGNED NOT NULL AUTO_INCREMENT,
|
||||
`bantime` DATETIME NOT NULL,
|
||||
@@ -468,6 +498,7 @@ CREATE TABLE `ban` (
|
||||
KEY `idx_ban_isbanned_details` (`ckey`,`ip`,`computerid`,`role`,`unbanned_datetime`,`expiration_time`),
|
||||
KEY `idx_ban_count` (`bantime`,`a_ckey`,`applies_to_admins`,`unbanned_datetime`,`expiration_time`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
|
||||
```
|
||||
|
||||
----------------------------------------------------
|
||||
|
||||
Reference in New Issue
Block a user