adds recording who deleted a note (#50445)

It came up that this isn't recorded, only logged.

Technically needs syncing merge with schema change but only deleting notes would break from this and tbh that isn't done very often so I think it'd be fine to yolo.
This commit is contained in:
Jordie
2020-04-18 09:28:34 +10:00
committed by GitHub
parent 3d10cee821
commit 4c7dfbc655
5 changed files with 15 additions and 5 deletions

View File

@@ -1,15 +1,22 @@
Any time you make a change to the schema files, remember to increment the database schema version. Generally increment the minor number, major should be reserved for significant changes to the schema. Both values go up to 255.
The latest database version is 5.7; The query to update the schema revision table is:
The latest database version is 5.8; The query to update the schema revision table is:
INSERT INTO `schema_revision` (`major`, `minor`) VALUES (5, 7);
INSERT INTO `schema_revision` (`major`, `minor`) VALUES (5, 8);
or
INSERT INTO `SS13_schema_revision` (`major`, `minor`) VALUES (5, 7);
INSERT INTO `SS13_schema_revision` (`major`, `minor`) VALUES (5, 8);
In any query remember to add a prefix to the table names if you use one.
-----------------------------------------------------
Version 5.8, 7 April 2020, by Jordie0608
Modified table `messages`, adding column `deleted_ckey` to record who deleted a message.
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.

View File

@@ -258,6 +258,7 @@ CREATE TABLE `messages` (
`lasteditor` varchar(32) DEFAULT NULL,
`edits` text,
`deleted` tinyint(1) unsigned NOT NULL DEFAULT '0',
`deleted_ckey` VARCHAR(32) NULL DEFAULT NULL,
PRIMARY KEY (`id`),
KEY `idx_msg_ckey_time` (`targetckey`,`timestamp`, `deleted`),
KEY `idx_msg_type_ckeys_time` (`type`,`targetckey`,`adminckey`,`timestamp`, `deleted`),

View File

@@ -258,6 +258,7 @@ CREATE TABLE `SS13_messages` (
`lasteditor` varchar(32) DEFAULT NULL,
`edits` text,
`deleted` tinyint(1) unsigned NOT NULL DEFAULT '0',
`deleted_ckey` VARCHAR(32) NULL DEFAULT NULL,
PRIMARY KEY (`id`),
KEY `idx_msg_ckey_time` (`targetckey`,`timestamp`, `deleted`),
KEY `idx_msg_type_ckeys_time` (`type`,`targetckey`,`adminckey`,`timestamp`, `deleted`),