clean up and and incremented DB version (#5477)

makes https://github.com/Skyrat-SS13/Skyrat-tg/pull/5422 conform to database standards
This commit is contained in:
ORCACommander
2021-05-05 12:25:51 -04:00
committed by GitHub
parent cc5b83d29c
commit 8df04ad6c5
2 changed files with 30 additions and 31 deletions

View File

@@ -2,15 +2,41 @@ Any time you make a change to the schema files, remember to increment the databa
The latest database version is 5.13; The query to update the schema revision table is:
INSERT INTO `schema_revision` (`major`, `minor`) VALUES (5, 13);
INSERT INTO `schema_revision` (`major`, `minor`) VALUES (5, 14);
or
INSERT INTO `SS13_schema_revision` (`major`, `minor`) VALUES (5, 13);
INSERT INTO `SS13_schema_revision` (`major`, `minor`) VALUES (5, 14);
In any query remember to add a prefix to the table names if you use one.
-----------------------------------------------------
<<<<<<< HEAD
Version 5.14, 30 April 2021, by Atlanta Ned
Added the `citation` table for tracking security citations in the database.
CREATE TABLE `citation` (
`id` INT(10) UNSIGNED NOT NULL AUTO_INCREMENT,
`round_id` INT(11) UNSIGNED NOT NULL,
`server_ip` INT(11) UNSIGNED NOT NULL,
`server_port` INT(11) UNSIGNED NOT NULL,
`citation` TEXT NOT NULL COLLATE 'utf8mb4_general_ci',
`action` VARCHAR(20) NOT NULL DEFAULT '' COLLATE 'utf8mb4_general_ci',
`sender` VARCHAR(32) NOT NULL DEFAULT '' COLLATE 'utf8mb4_general_ci',
`sender_ic` VARCHAR(64) NOT NULL DEFAULT '' COMMENT 'Longer because this is the character name, not the ckey' COLLATE 'utf8mb4_general_ci',
`recipient` VARCHAR(64) NOT NULL DEFAULT '' COMMENT 'Longer because this is the character name, not the ckey' COLLATE 'utf8mb4_general_ci',
`crime` TEXT NOT NULL COLLATE 'utf8mb4_general_ci',
`fine` INT(4) NULL DEFAULT NULL,
`paid` INT(4) NULL DEFAULT '0',
`timestamp` DATETIME NOT NULL,
PRIMARY KEY (`id`) USING BTREE,
UNIQUE INDEX `idx_constraints` (`round_id`, `server_ip`, `server_port`, `citation`(100)) USING BTREE
)
COLLATE='utf8mb4_general_ci'
ENGINE=InnoDB
AUTO_INCREMENT=1
;
-----------------------------------------------------
Version 5.13, 9 March, 2021, by Useroth
Implemented some features to help with running multiple servers on the same database and easily differentiate
@@ -39,34 +65,7 @@ ALTER TABLE `messages`
ALTER TABLE `round`
ADD COLUMN `server_name` VARCHAR(32) DEFAULT NULL AFTER `end_datetime`;
=======
Version 5.13, 30 April 2021, by Atlanta Ned
Added the `citation` table for tracking security citations in the database.
```
CREATE TABLE `citation` (
`id` INT(10) UNSIGNED NOT NULL AUTO_INCREMENT,
`round_id` INT(11) UNSIGNED NOT NULL,
`server_ip` INT(11) UNSIGNED NOT NULL,
`server_port` INT(11) UNSIGNED NOT NULL,
`citation` TEXT NOT NULL COLLATE 'utf8mb4_general_ci',
`action` VARCHAR(20) NOT NULL DEFAULT '' COLLATE 'utf8mb4_general_ci',
`sender` VARCHAR(32) NOT NULL DEFAULT '' COLLATE 'utf8mb4_general_ci',
`sender_ic` VARCHAR(64) NOT NULL DEFAULT '' COMMENT 'Longer because this is the character name, not the ckey' COLLATE 'utf8mb4_general_ci',
`recipient` VARCHAR(64) NOT NULL DEFAULT '' COMMENT 'Longer because this is the character name, not the ckey' COLLATE 'utf8mb4_general_ci',
`crime` TEXT NOT NULL COLLATE 'utf8mb4_general_ci',
`fine` INT(4) NULL DEFAULT NULL,
`paid` INT(4) NULL DEFAULT '0',
`timestamp` DATETIME NOT NULL,
PRIMARY KEY (`id`) USING BTREE,
UNIQUE INDEX `idx_constraints` (`round_id`, `server_ip`, `server_port`, `citation`(100)) USING BTREE
)
COLLATE='utf8mb4_general_ci'
ENGINE=InnoDB
AUTO_INCREMENT=1
;
```
>>>>>>> e3b1e3c8c50 (Security citations are now logged to the DB (#58827))
-----------------------------------------------------