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

This commit is contained in:
Carlos Satorres 2023-06-29 06:24:13 +02:00
parent dce5394cb9
commit 0a78dd344f
2 changed files with 25 additions and 14 deletions

View File

@ -1,13 +1,25 @@
-- 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;
CREATE TABLE `supplierAccount` (
`id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT,
`supplierFk` int(11) DEFAULT NULL,
`iban` varchar(30) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci DEFAULT NULL,
`office` varchar(4) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci DEFAULT NULL,
`DC` varchar(2) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci DEFAULT NULL,
`number` varchar(10) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci DEFAULT NULL,
`description__` varchar(45) DEFAULT NULL COMMENT '@deprecated 2023-03-23',
`bankEntityFk` int(10) unsigned DEFAULT NULL,
`accountingFk` int(11) DEFAULT NULL,
`beneficiary` varchar(50) DEFAULT NULL,
`editorFk` int(10) unsigned DEFAULT NULL,
`countryFk` int(10) unsigned UNIQUE KEY,
`companyFk` int(10) unsigned UNIQUE KEY,
PRIMARY KEY (`id`),
KEY `fk_proveedores_proveedores_account_idx` (`supplierFk`),
KEY `fk_Proveedores_account_entity1_idx` (`bankEntityFk`),
KEY `fk_banco_prov_account_idx` (`accountingFk`),
KEY `supplierAccount_fk_editor` (`editorFk`),
CONSTRAINT `supplierAccount_FK` FOREIGN KEY (`supplierFk`) REFERENCES `supplier` (`id`) ON UPDATE CASCADE,
CONSTRAINT `supplierAccount_FK_1` FOREIGN KEY (`bankEntityFk`) REFERENCES `bankEntity` (`id`) ON UPDATE CASCADE,
CONSTRAINT `supplierAccount_fk_editor` FOREIGN KEY (`editorFk`) REFERENCES `account`.`user` (`id`),
CONSTRAINT `supplierAccount_FK_country` FOREIGN KEY (`countryFk`) REFERENCES `vn`.`country` (`id`),
CONSTRAINT `supplierAccount_FK_company` FOREIGN KEY (`companyFk`) REFERENCES `vn`.`company` (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=242 DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_unicode_ci;

View File

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