salix/db/changes/234601/00-sectorBackUpLabelerFk.sql

20 lines
1.2 KiB
MySQL
Raw Normal View History

ALTER TABLE `vn`.`sector` CHANGE `mainPrinterFk` `backupPrinterFk` tinyint(3) unsigned DEFAULT NULL NULL;
ALTER TABLE `util`.`notificationSubscription` DROP FOREIGN KEY `notificationSubscription_ibfk_1`;
ALTER TABLE `util`.`notificationQueue` DROP FOREIGN KEY `nnotificationQueue_ibfk_1`;
ALTER TABLE `util`.`notificationAcl` DROP FOREIGN KEY `notificationAcl_ibfk_1`;
ALTER TABLE `util`.`notification` MODIFY COLUMN `id` int(11) auto_increment NOT NULL;
ALTER TABLE `util`.`notificationSubscription` ADD CONSTRAINT `notificationSubscription_Fk` FOREIGN KEY (`notificationFk`) REFERENCES `util`.`notification`(`id`);
ALTER TABLE `util`.`notificationQueue` ADD CONSTRAINT `notificationQueue_Fk` FOREIGN KEY (`notificationFk`) REFERENCES `util`.`notification`(`name`);
ALTER TABLE `util`.`notificationAcl` ADD CONSTRAINT `notificationAcl_Fk` FOREIGN KEY (`notificationFk`) REFERENCES `util`.`notification`(`id`);
DELETE FROM `util`.`notification`
WHERE `name` = 'not-main-printer-configured';
INSERT INTO `util`.`notification`
SET `id` = 15,
`name` = 'backup-printer-selected',
`description` = 'The worker has selected the backup printer for their sector';