refs #6372
gitea/salix/pipeline/pr-dev This commit looks good Details

This commit is contained in:
David Domenech 2024-02-21 07:35:57 +01:00
parent 913e7aa1d8
commit 1cf17a3d8d
2 changed files with 8 additions and 8 deletions

View File

@ -8,4 +8,4 @@ AS SELECT
`es`.`amount` AS `importe`,
`es`.`companyFk` AS `empresa_id`
FROM
`vn`.`expenseSummary` `es`;
`vn`.`expenseManual` `es`;

View File

@ -1,18 +1,18 @@
ALTER TABLE IF EXISTS vn2008.gastos_resumen DROP FOREIGN KEY IF EXISTS gastos_resumen_expense_FK;
ALTER TABLE IF EXISTS `vn2008`.`gastos_resumen` RENAME `vn`.`expenseSummary`;
ALTER TABLE IF EXISTS `vn2008`.`gastos_resumen` RENAME `vn`.`expenseManual`;
ALTER TABLE IF EXISTS `vn`.`expenseSummary`
ALTER TABLE IF EXISTS `vn`.`expenseManual`
CHANGE COLUMN IF EXISTS `Id_Gasto` `expenseFk` varchar(10) NOT NULL,
CHANGE COLUMN IF EXISTS `importe` `amount` decimal(10,2) DEFAULT NULL,
CHANGE COLUMN IF EXISTS `empresa_id` `companyFk` int(11) NOT NULL;
ALTER TABLE IF EXISTS vn.expenseSummary COLLATE=utf8mb3_general_ci;
ALTER TABLE IF EXISTS vn.expenseManual COLLATE=utf8mb3_general_ci;
ALTER TABLE IF EXISTS vn.expenseSummary MODIFY COLUMN IF EXISTS expenseFk varchar(10) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL;
ALTER TABLE IF EXISTS vn.expenseManual MODIFY COLUMN IF EXISTS expenseFk varchar(10) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL;
ALTER TABLE IF EXISTS vn.expenseSummary ADD CONSTRAINT expenseSummary_expense_FK FOREIGN KEY IF NOT EXISTS (expenseFk) REFERENCES vn.expense(id) ON DELETE CASCADE ON UPDATE CASCADE;
ALTER TABLE IF EXISTS vn.expenseManual ADD CONSTRAINT expenseManual_expense_FK FOREIGN KEY IF NOT EXISTS (expenseFk) REFERENCES vn.expense(id) ON DELETE CASCADE ON UPDATE CASCADE;
ALTER TABLE IF EXISTS vn.expenseSummary MODIFY COLUMN IF EXISTS companyFk int(10) unsigned NOT NULL;
ALTER TABLE IF EXISTS vn.expenseManual MODIFY COLUMN IF EXISTS companyFk int(10) unsigned NOT NULL;
ALTER TABLE IF EXISTS vn.expenseSummary ADD CONSTRAINT expenseSummary_company_FK FOREIGN KEY IF NOT EXISTS (companyFk) REFERENCES vn.company(id) ON DELETE CASCADE ON UPDATE CASCADE;
ALTER TABLE IF EXISTS vn.expenseManual ADD CONSTRAINT expenseManual_company_FK FOREIGN KEY IF NOT EXISTS (companyFk) REFERENCES vn.company(id) ON DELETE CASCADE ON UPDATE CASCADE;