diff --git a/db/changes/231801/00-accountCountry.sql b/db/changes/231801/00-accountCountry.sql deleted file mode 100644 index 05e9d83f1..000000000 --- a/db/changes/231801/00-accountCountry.sql +++ /dev/null @@ -1,10 +0,0 @@ --- vn.accountCountry definition - -CREATE TABLE `vn`.`accountCountry` ( - `supplierAccountFk` mediumint(8) unsigned DEFAULT NULL, - `countryFk` mediumint(8) unsigned DEFAULT NULL, - KEY `supplierAccountFk` (`supplierAccountFk`), - KEY `countryFk` (`countryFk`), - CONSTRAINT `accountCountry_ibfk_1` FOREIGN KEY (`supplierAccountFk`) REFERENCES `supplierAccount` (`id`), - CONSTRAINT `accountCountry_ibfk_2` FOREIGN KEY (`countryFk`) REFERENCES `country` (`id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci; \ No newline at end of file diff --git a/db/changes/232601/00-accountCountry.sql b/db/changes/232601/00-accountCountry.sql new file mode 100644 index 000000000..f92abd9df --- /dev/null +++ b/db/changes/232601/00-accountCountry.sql @@ -0,0 +1,13 @@ +-- vn.supplierAccountContry definition + +CREATE TABLE `supplierAccountCountry` ( + `supplierAccountFk` mediumint(8) unsigned NOT NULL, + `companyFk` int(11) DEFAULT NULL, + `countryFk` mediumint(8) unsigned NOT NULL, + PRIMARY KEY (`supplierAccountFk`), + UNIQUE KEY `countryFk` (`countryFk`), + UNIQUE KEY `companyFk` (`companyFk`), + CONSTRAINT `companyFk_supplier` FOREIGN KEY (`companyFk`) REFERENCES `supplierAccount` (`supplierFk`) ON UPDATE CASCADE, + CONSTRAINT `countryFk_id` FOREIGN KEY (`countryFk`) REFERENCES `country` (`id`) ON UPDATE CASCADE, + CONSTRAINT `supplierAccountFk_id` FOREIGN KEY (`supplierAccountFk`) REFERENCES `supplierAccount` (`id`) ON UPDATE CASCADE +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci; diff --git a/db/changes/232601/00-supplierDefault.sql b/db/changes/232601/00-supplierDefault.sql new file mode 100644 index 000000000..c411558f1 --- /dev/null +++ b/db/changes/232601/00-supplierDefault.sql @@ -0,0 +1 @@ +ALTER TABLE vn.supplier ADD defaultAccountFk varchar(100) DEFAULT NULL NULL;