mirror of
https://github.com/yogstation13/Yogstation.git
synced 2025-02-26 09:04:50 +00:00
Adds role time log table and triggers (#37763)
* adds role time log table and triggers * typo * whoops also typo here
This commit is contained in:
@@ -1,15 +1,34 @@
|
||||
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 4.1; The query to update the schema revision table is:
|
||||
The latest database version is 4.3; The query to update the schema revision table is:
|
||||
|
||||
INSERT INTO `schema_revision` (`major`, `minor`) VALUES (4, 2);
|
||||
INSERT INTO `schema_revision` (`major`, `minor`) VALUES (4, 3);
|
||||
or
|
||||
INSERT INTO `SS13_schema_revision` (`major`, `minor`) VALUES (4, 2);
|
||||
INSERT INTO `SS13_schema_revision` (`major`, `minor`) VALUES (4, 3);
|
||||
|
||||
In any query remember to add a prefix to the table names if you use one.
|
||||
|
||||
----------------------------------------------------
|
||||
|
||||
Version 4.3, 9 May 2018, by MrStonedOne
|
||||
Added table `role_time_log` and triggers `role_timeTlogupdate`, `role_timeTloginsert` and `role_timeTlogdelete` to update it from changes to `role_time`
|
||||
|
||||
CREATE TABLE `role_time_log` ( `id` BIGINT NOT NULL AUTO_INCREMENT , `ckey` VARCHAR(32) NOT NULL , `job` VARCHAR(128) NOT NULL , `delta` INT NOT NULL , `datetime` TIMESTAMP on update CURRENT_TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP , PRIMARY KEY (`id`), INDEX (`ckey`), INDEX (`job`), INDEX (`datetime`)) ENGINE = InnoDB;
|
||||
|
||||
DELIMITER
|
||||
$$
|
||||
CREATE TRIGGER `role_timeTlogupdate` AFTER UPDATE ON `role_time` FOR EACH ROW BEGIN INSERT into role_time_log (ckey, job, delta) VALUES (NEW.CKEY, NEW.job, NEW.minutes-OLD.minutes);
|
||||
END
|
||||
$$
|
||||
CREATE TRIGGER `role_timeTloginsert` AFTER INSERT ON `role_time` FOR EACH ROW BEGIN INSERT into role_time_log (ckey, job, delta) VALUES (NEW.ckey, NEW.job, NEW.minutes);
|
||||
END
|
||||
$$
|
||||
CREATE TRIGGER `role_timeTlogdelete` AFTER DELETE ON `role_time` FOR EACH ROW BEGIN INSERT into role_time_log (ckey, job, delta) VALUES (OLD.ckey, OLD.job, 0-OLD.minutes);
|
||||
END
|
||||
$$
|
||||
|
||||
----------------------------------------------------
|
||||
|
||||
Version 4.2, 17 April 2018, by Jordie0608
|
||||
Modified table 'admin', adding the columns 'round_id' and 'target'
|
||||
ALTER TABLE `admin_log`
|
||||
|
||||
Reference in New Issue
Block a user