summaryrefslogtreecommitdiff
path: root/db/update.sql
diff options
context:
space:
mode:
authorPhilip Häusler <msquare@notrademark.de>2014-12-26 01:49:59 +0100
committerPhilip Häusler <msquare@notrademark.de>2014-12-26 01:49:59 +0100
commit8ed077bcece00bd056a878c86a9cf2c672d4306e (patch)
treeba3c7ce9cf21dfcb2927f4a3b59086979dd41fae /db/update.sql
parent33bafad9b7ffc7ec65779c6cf493dbcecf9ea4b3 (diff)
user voucher feature
Diffstat (limited to 'db/update.sql')
-rw-r--r--db/update.sql9
1 files changed, 6 insertions, 3 deletions
diff --git a/db/update.sql b/db/update.sql
index 681d2a7c..db7d75ed 100644
--- a/db/update.sql
+++ b/db/update.sql
@@ -1,3 +1,6 @@
+/* introduce got-voucher flag */
+ALTER TABLE `User` ADD `got_voucher` BOOLEAN NOT NULL;
+
/* introduce shift types */
CREATE TABLE IF NOT EXISTS `ShiftTypes` (
`id` int(11) NOT NULL AUTO_INCREMENT,
@@ -7,8 +10,8 @@ CREATE TABLE IF NOT EXISTS `ShiftTypes` (
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1;
ALTER TABLE `ShiftTypes` ADD INDEX ( `angeltype_id` );
-ALTER TABLE `ShiftTypes` ADD FOREIGN KEY ( `angeltype_id` ) REFERENCES `engelsystem`.`AngelTypes` (`id`) ON DELETE CASCADE ON UPDATE CASCADE;
-INSERT INTO `engelsystem`.`Privileges` (`id`, `name`, `desc`) VALUES (NULL , 'shifttypes', 'Administrate shift types');
+ALTER TABLE `ShiftTypes` ADD FOREIGN KEY ( `angeltype_id` ) REFERENCES `AngelTypes` (`id`) ON DELETE CASCADE ON UPDATE CASCADE;
+INSERT INTO `Privileges` (`id`, `name`, `desc`) VALUES (NULL , 'shifttypes', 'Administrate shift types');
INSERT INTO `GroupPrivileges` SET `group_id`=-5, `privilege_id`=(SELECT `id` FROM `Privileges` WHERE `name`='shifttypes');
ALTER TABLE `Shifts` ADD `shifttype_id` INT NOT NULL AFTER `SID`, ADD INDEX ( `shifttype_id` );
@@ -16,7 +19,7 @@ UPDATE `Shifts` SET `name`='' WHERE `name` IS NULL;
INSERT INTO `ShiftTypes` SELECT DISTINCT NULL , `name` , NULL , '' FROM `Shifts`;
UPDATE `Shifts` SET `shifttype_id`=(SELECT `id` FROM `ShiftTypes` WHERE `ShiftTypes`.`name`=`Shifts`.`name`);
ALTER TABLE `Shifts` ADD `title` TEXT NULL AFTER `SID`;
-ALTER TABLE `Shifts` ADD FOREIGN KEY ( `shifttype_id` ) REFERENCES `engelsystem`.`ShiftTypes` (`id`) ON DELETE CASCADE ON UPDATE CASCADE;
+ALTER TABLE `Shifts` ADD FOREIGN KEY ( `shifttype_id` ) REFERENCES `ShiftTypes` (`id`) ON DELETE CASCADE ON UPDATE CASCADE;
ALTER TABLE `Shifts` DROP `name`;
/* cleanup */