diff options
author | Philip Häusler <msquare@notrademark.de> | 2014-12-26 01:49:59 +0100 |
---|---|---|
committer | Philip Häusler <msquare@notrademark.de> | 2014-12-26 01:49:59 +0100 |
commit | 8ed077bcece00bd056a878c86a9cf2c672d4306e (patch) | |
tree | ba3c7ce9cf21dfcb2927f4a3b59086979dd41fae /db | |
parent | 33bafad9b7ffc7ec65779c6cf493dbcecf9ea4b3 (diff) |
user voucher feature
Diffstat (limited to 'db')
-rw-r--r-- | db/install.sql | 6 | ||||
-rw-r--r-- | db/update.sql | 9 |
2 files changed, 6 insertions, 9 deletions
diff --git a/db/install.sql b/db/install.sql index 5c612d54..2ce71d9e 100644 --- a/db/install.sql +++ b/db/install.sql @@ -11,12 +11,6 @@ SET FOREIGN_KEY_CHECKS=0; SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO"; SET time_zone = "+00:00"; --- --- Datenbank: `engelsystem` --- -CREATE DATABASE IF NOT EXISTS `engelsystem` DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci; -USE `engelsystem`; - -- -------------------------------------------------------- -- 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 */ |