diff options
author | Philip Häusler <msquare@notrademark.de> | 2015-08-15 23:36:38 +0200 |
---|---|---|
committer | Philip Häusler <msquare@notrademark.de> | 2015-08-15 23:36:38 +0200 |
commit | a7189482e92556c33b5a320989faa97be98c82bc (patch) | |
tree | 814e5dd9b0958685a5d974de0a46c59f72e5ca1f /db | |
parent | cac86ef509de8543d473db421898b80ca3b8f8e3 (diff) |
add shift creator and editor
Diffstat (limited to 'db')
-rw-r--r-- | db/update.sql | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/db/update.sql b/db/update.sql index 594969f9..3dbd613a 100644 --- a/db/update.sql +++ b/db/update.sql @@ -1,3 +1,16 @@ +/* more shift infos */ +ALTER TABLE `Shifts` ADD `created_by_user_id` INT NOT NULL , +ADD `created_at_timestamp` INT NOT NULL , +ADD `edited_by_user_id` INT NOT NULL , +ADD `edited_at_timestamp` INT NOT NULL; +ALTER TABLE `Shifts` ADD INDEX ( `created_by_user_id` ); +ALTER TABLE `Shifts` ADD INDEX ( `edited_by_user_id` ); +ALTER TABLE `Shifts` CHANGE `created_by_user_id` `created_by_user_id` INT( 11 ) NULL ; +ALTER TABLE `Shifts` CHANGE `edited_by_user_id` `edited_by_user_id` INT( 11 ) NULL ; +update Shifts set created_by_user_id=null, edited_by_user_id=null; +ALTER TABLE `Shifts` ADD FOREIGN KEY ( `created_by_user_id` ) REFERENCES `engelsystem`.`User` (`UID`) ON DELETE SET NULL ON UPDATE CASCADE ; +ALTER TABLE `Shifts` ADD FOREIGN KEY ( `edited_by_user_id` ) REFERENCES `engelsystem`.`User` (`UID`) ON DELETE SET NULL ON UPDATE CASCADE ; + /* Introduce planned departure date */ ALTER TABLE `User` ADD `planned_departure_date` INT NULL, ADD INDEX ( `planned_departure_date` ); |