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

18 lines
804 B
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');