Security citations are now logged to the DB (#5422)

Co-authored-by: Nick <nick@nfreader.net>
This commit is contained in:
SkyratBot
2021-05-03 15:12:59 +01:00
committed by GitHub
co-authored by Nick
parent 5e47986679
commit 336d99adcd
7 changed files with 130 additions and 2 deletions
+29
View File
@@ -10,6 +10,7 @@ In any query remember to add a prefix to the table names if you use one.
-----------------------------------------------------
<<<<<<< HEAD
Version 5.13, 9 March, 2021, by Useroth
Implemented some features to help with running multiple servers on the same database and easily differentiate
@@ -38,6 +39,34 @@ 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))
-----------------------------------------------------
+25
View File
@@ -100,6 +100,31 @@ CREATE TABLE `ban` (
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Table structure for table `citation`
--
DROP TABLE IF EXISTS `citation`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE IF NOT EXISTS `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,
`action` varchar(20) NOT NULL DEFAULT '',
`sender` varchar(32) NOT NULL DEFAULT '',
`sender_ic` varchar(64) NOT NULL DEFAULT '' COMMENT 'Longer because this is the character name, not the ckey',
`recipient` varchar(64) NOT NULL DEFAULT '' COMMENT 'Longer because this is the character name, not the ckey',
`crime` text NOT NULL,
`fine` int(4) DEFAULT NULL,
`paid` int(4) DEFAULT 0,
`timestamp` datetime NOT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `idx_constraints` (`round_id`,`server_ip`,`server_port`,`citation`(100)) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8mb4;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Table structure for table `connection_log`
--
+25
View File
@@ -100,6 +100,31 @@ CREATE TABLE `SS13_ban` (
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Table structure for table `citation`
--
DROP TABLE IF EXISTS `SS13_citation`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE IF NOT EXISTS `SS13_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,
`action` varchar(20) NOT NULL DEFAULT '',
`sender` varchar(32) NOT NULL DEFAULT '',
`sender_ic` varchar(64) NOT NULL DEFAULT '' COMMENT 'Longer because this is the character name, not the ckey',
`recipient` varchar(64) NOT NULL DEFAULT '' COMMENT 'Longer because this is the character name, not the ckey',
`crime` text NOT NULL,
`fine` int(4) DEFAULT NULL,
`paid` int(4) DEFAULT 0,
`timestamp` datetime NOT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `idx_constraints` (`round_id`,`server_ip`,`server_port`,`citation`(100)) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8mb4;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Table structure for table `SS13_connection_log`
--