2016-10-05 18:56:50 +02:00
INSERT INTO ` Privileges ` ( ` id ` , ` name ` , ` desc ` ) VALUES ( 40 , ' view_rooms ' , ' User can view rooms ' ) ;
INSERT INTO ` GroupPrivileges ` ( ` id ` , ` group_id ` , ` privilege_id ` ) VALUES ( NULL , ' -2 ' , ' 40 ' ) ;
2016-11-11 14:59:25 +01:00
2016-11-11 15:24:51 +01:00
ALTER TABLE ` UserAngelTypes ` CHANGE ` coordinator ` ` supporter ` BOOLEAN ;
2016-11-17 23:14:39 +01:00
ALTER TABLE ` User ` ADD COLUMN ` email_by_human_allowed ` BOOLEAN NOT NULL ;
-- No Self Sign Up for some Angel Types
2016-12-13 18:07:36 +01:00
ALTER TABLE AngelTypes ADD no_self_signup TINYINT ( 1 ) NOT NULL ;
2016-12-13 17:58:41 +01:00
2017-08-29 22:22:53 +02:00
ALTER TABLE ` AngelTypes `
ADD ` contact_user_id ` INT NULL ,
ADD ` contact_name ` VARCHAR ( 250 ) NULL ,
ADD ` contact_dect ` VARCHAR ( 5 ) NULL ,
ADD ` contact_email ` VARCHAR ( 250 ) NULL ,
2016-12-13 17:58:41 +01:00
ADD INDEX ( ` contact_user_id ` ) ;
2017-08-29 22:22:53 +02:00
ALTER TABLE ` AngelTypes `
2016-12-13 17:58:41 +01:00
ADD FOREIGN KEY ( ` contact_user_id ` ) REFERENCES ` User ` ( ` UID ` ) ON DELETE SET NULL ON UPDATE CASCADE ;
2016-12-24 17:00:03 +01:00
INSERT INTO ` Privileges ` ( ` id ` , ` name ` , ` desc ` ) VALUES ( NULL , ' shiftentry_edit_angeltype_supporter ' , ' If user with this privilege is angeltype supporter, he can put users in shifts for their angeltype ' ) ;
2016-12-26 14:26:49 +01:00
-- DB Performance
ALTER TABLE ` Shifts ` ADD INDEX ( ` start ` ) ;
2017-08-29 22:22:53 +02:00
ALTER TABLE ` NeededAngelTypes ` ADD INDEX ( ` count ` ) ;
-- Security
UPDATE ` Groups ` SET UID = UID * 10 ;
INSERT INTO ` Groups ` ( Name , UID ) VALUES ( ' News Admin ' , - 65 ) ;
INSERT INTO ` Privileges ` ( id , name , ` desc ` ) VALUES ( 42 , ' admin_news_html ' , ' Use HTML in news ' ) ;
INSERT INTO ` GroupPrivileges ` ( group_id , privilege_id ) VALUES ( - 65 , 14 ) , ( - 65 , 42 ) ;
2017-09-19 19:33:24 +02:00
-- Add log level to LogEntries
ALTER TABLE ` LogEntries ` CHANGE COLUMN ` nick ` ` level ` VARCHAR ( 20 ) NOT NULL ;
2017-11-24 10:02:52 +01:00
-- Angeltype contact update
ALTER TABLE ` AngelTypes ` DROP FOREIGN KEY angeltypes_ibfk_1 ;
2017-12-10 15:02:37 +01:00
ALTER TABLE ` AngelTypes ` DROP ` contact_user_id ` ;
-- Room update
ALTER TABLE ` Room ` DROP ` Number ` ;
ALTER TABLE ` Room ` DROP ` show ` ;
ALTER TABLE ` Room ` DROP ` Man ` ;
ALTER TABLE ` Room ` ADD ` from_frab ` BOOLEAN NOT NULL AFTER ` FromPentabarf ` ;
update Room set ` from_frab ` = ( ` FromPentabarf ` = ' Y ' ) ;
ALTER TABLE ` Room ` DROP ` FromPentabarf ` ;
ALTER TABLE ` Room ` ADD ` map_url ` VARCHAR ( 300 ) NULL AFTER ` from_frab ` ;
ALTER TABLE ` Room ` ADD ` description ` TEXT NULL AFTER ` map_url ` ;