salix/db/changes/10180-holyWeek/00-claimState.sql

28 lines
1.3 KiB
SQL

ALTER TABLE `vn`.`claimState`
DROP FOREIGN KEY `roleFgn`;
ALTER TABLE `vn`.`claimState`
ADD COLUMN `code` VARCHAR(45) CHARACTER SET 'utf8' COLLATE 'utf8_general_ci' NULL AFTER `id`,
CHANGE COLUMN `roleFk` `roleFk` INT(10) UNSIGNED NOT NULL DEFAULT '1' ;
ALTER TABLE `vn`.`claimState`
ADD CONSTRAINT `roleFgn`
FOREIGN KEY (`roleFk`)
REFERENCES `account`.`role` (`id`)
ON UPDATE CASCADE;
UPDATE `vn`.`claimState` SET `code` = 'pending' WHERE (`id` = '1');
UPDATE `vn`.`claimState` SET `code` = 'canceled' WHERE (`id` = '4');
UPDATE `vn`.`claimState` SET `code` = 'resolved' WHERE (`id` = '3');
UPDATE `vn`.`claimState` SET `code` = 'disputed' WHERE (`id` = '5');
UPDATE `vn`.`claimState` SET `code` = 'mana' WHERE (`id` = '6');
UPDATE `vn`.`claimState` SET `code` = 'managed' WHERE (`id` = '2');
ALTER TABLE `vn`.`claimState`
ADD COLUMN `priority` INT NOT NULL DEFAULT 1 AFTER `roleFk`;
UPDATE `vn`.`claimState` SET `priority` = '1' WHERE (`id` = '1');
UPDATE `vn`.`claimState` SET `priority` = '5' WHERE (`id` = '2');
UPDATE `vn`.`claimState` SET `priority` = '7' WHERE (`id` = '3');
UPDATE `vn`.`claimState` SET `priority` = '6' WHERE (`id` = '4');
UPDATE `vn`.`claimState` SET `priority` = '3' WHERE (`id` = '5');
UPDATE `vn`.`claimState` SET `priority` = '4' WHERE (`id` = '6');
UPDATE `vn`.`claimState` SET `priority` = '2' WHERE (`id` = '7');