salix/db/changes/10141-kings/03-address.sql

26 lines
747 B
SQL

ALTER TABLE `vn`.`address`
ADD COLUMN `customsAgentFk` INT NULL DEFAULT NULL AFTER `isEqualizated`;
ALTER TABLE `vn`.`address`
ADD COLUMN `incotermsFk` VARCHAR(3) NULL DEFAULT NULL AFTER `customsAgentFk`;
ALTER TABLE `vn`.`address`
ADD INDEX `address_customsAgentFk_idx` (`customsAgentFk` ASC);
ALTER TABLE `vn`.`address`
ADD INDEX `address_incotermsFk_idx` (`incotermsFk` ASC);
ALTER TABLE `vn`.`address`
ADD CONSTRAINT `address_customsAgentFk`
FOREIGN KEY (`customsAgentFk`)
REFERENCES `vn`.`customsAgent` (`id`)
ON DELETE RESTRICT
ON UPDATE CASCADE;
ALTER TABLE `vn`.`address`
ADD CONSTRAINT `address_incotermsFk`
FOREIGN KEY (`incotermsFk`)
REFERENCES `vn`.`incoterms` (`code`)
ON DELETE RESTRICT
ON UPDATE CASCADE;