diff options
author | msquare <msquare@notrademark.de> | 2017-12-29 19:06:23 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-12-29 19:06:23 +0100 |
commit | 372f474dbcf7524cc10aff0be0bb39c1a90df1f4 (patch) | |
tree | 3870eaeaa468caeee9c24f63f0f942a7548aba3b /db | |
parent | 14584b96114d2fcb0dabe49a9c857ff241421cc8 (diff) | |
parent | 4579509b0e21d33ae27ecb5910fdc1d31b1e027a (diff) |
Merge pull request #407 from engelsystem/feature-work-log
Feature work log
Diffstat (limited to 'db')
-rw-r--r-- | db/update.sql | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/db/update.sql b/db/update.sql index 212cd97e..56663071 100644 --- a/db/update.sql +++ b/db/update.sql @@ -49,3 +49,11 @@ ALTER TABLE `Room` ADD `description` TEXT NULL AFTER `map_url`; -- Dashboard ALTER TABLE `AngelTypes` ADD `show_on_dashboard` BOOLEAN NOT NULL AFTER `contact_email`; UPDATE `AngelTypes` SET `show_on_dashboard` = TRUE; + +-- Work Log +CREATE TABLE `UserWorkLog` ( `id` INT NOT NULL AUTO_INCREMENT , `user_id` INT NOT NULL , `work_hours` DECIMAL NOT NULL , `comment` VARCHAR(200) NOT NULL , `created_user_id` INT NOT NULL , `created_timestamp` INT NOT NULL , PRIMARY KEY (`id`), INDEX (`user_id`), INDEX (`created_user_id`)) ENGINE = InnoDB; +ALTER TABLE `UserWorkLog` ADD FOREIGN KEY (`created_user_id`) REFERENCES `User`(`UID`) ON DELETE CASCADE ON UPDATE CASCADE; ALTER TABLE `UserWorkLog` ADD FOREIGN KEY (`user_id`) REFERENCES `User`(`UID`) ON DELETE CASCADE ON UPDATE CASCADE; +ALTER TABLE `UserWorkLog` ADD INDEX(`created_timestamp`); +INSERT INTO `Privileges` (`id`, `name`, `desc`) VALUES (NULL, 'admin_user_worklog', 'Manage user work log entries.'); +ALTER TABLE `UserWorkLog` CHANGE `work_hours` `work_hours` DECIMAL(10,2) NOT NULL; +ALTER TABLE `UserWorkLog` ADD `work_timestamp` INT NOT NULL AFTER `user_id`; |