refs #5525 sql
gitea/salix/pipeline/head This commit looks good Details

This commit is contained in:
Carlos Satorres 2023-06-09 11:24:51 +02:00
parent 7fd87c4b04
commit de7b270d9e
3 changed files with 14 additions and 10 deletions

View File

@ -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;

View File

@ -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;

View File

@ -0,0 +1 @@
ALTER TABLE vn.supplier ADD defaultAccountFk varchar(100) DEFAULT NULL NULL;