From d48fd77f48ce87037cd683fe2bd43dafcefab7ea Mon Sep 17 00:00:00 2001 From: davidd Date: Thu, 22 Feb 2024 08:25:38 +0100 Subject: [PATCH 1/2] refs #6372 --- db/versions/10896-salmonOrchid/03-gastos_resumen.sql | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/db/versions/10896-salmonOrchid/03-gastos_resumen.sql b/db/versions/10896-salmonOrchid/03-gastos_resumen.sql index 5fa1f31fb..2308cb1fd 100644 --- a/db/versions/10896-salmonOrchid/03-gastos_resumen.sql +++ b/db/versions/10896-salmonOrchid/03-gastos_resumen.sql @@ -14,5 +14,11 @@ ALTER TABLE IF EXISTS vn.expenseManual ADD CONSTRAINT expenseManual_expense_FK F ALTER TABLE IF EXISTS vn.expenseManual MODIFY COLUMN IF EXISTS companyFk int(10) unsigned NOT NULL; +ALTER TABLE vn.expenseManual MODIFY COLUMN companyFk int(10) unsigned NULL; + +UPDATE vn.expenseManual + SET companyFK= NULL + WHERE companyFk= 0 + 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; From f4f6eeb6feb1bcf65b2f59a5a972793500fcd2c5 Mon Sep 17 00:00:00 2001 From: pablone Date: Thu, 22 Feb 2024 08:36:14 +0100 Subject: [PATCH 2/2] fix(version): refs #6372 add semicolon --- db/versions/10896-salmonOrchid/03-gastos_resumen.sql | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/db/versions/10896-salmonOrchid/03-gastos_resumen.sql b/db/versions/10896-salmonOrchid/03-gastos_resumen.sql index 2308cb1fd..dbb71bca2 100644 --- a/db/versions/10896-salmonOrchid/03-gastos_resumen.sql +++ b/db/versions/10896-salmonOrchid/03-gastos_resumen.sql @@ -18,7 +18,7 @@ ALTER TABLE vn.expenseManual MODIFY COLUMN companyFk int(10) unsigned NULL; UPDATE vn.expenseManual SET companyFK= NULL - WHERE companyFk= 0 + WHERE companyFk= 0; 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;