2022-06-09 05:13:54 +00:00
|
|
|
ALTER TABLE `vn`.`creditInsurance` ADD creditClassificationFk int(11) NULL;
|
2022-06-07 13:15:25 +00:00
|
|
|
|
|
|
|
UPDATE `vn`.`creditInsurance` AS `destiny`
|
2022-06-09 05:13:54 +00:00
|
|
|
SET `destiny`.`creditClassificationFk`= (SELECT creditClassification FROM `vn`.`creditInsurance` AS `origin` WHERE `origin`.id = `destiny`.id);
|
2022-06-07 13:15:25 +00:00
|
|
|
|
2022-06-09 05:13:54 +00:00
|
|
|
ALTER TABLE `vn`.`creditInsurance`
|
|
|
|
ADD CONSTRAINT `creditInsurance_creditClassificationFk` FOREIGN KEY (`creditClassificationFk`)
|
|
|
|
REFERENCES `creditClassification` (`id`) ON DELETE CASCADE ON UPDATE CASCADE;
|