From 903d85a2439d10eb2d6b1a51a16feb382770ed49 Mon Sep 17 00:00:00 2001 From: carlossa Date: Fri, 18 Oct 2024 14:06:39 +0200 Subject: [PATCH] fix: refs #7529 fix back --- .../00-firstScript.sql | 20 +++++++++---------- .../11312-navyAralia/00-firstScript.sql | 15 ++++++++++++++ 2 files changed, 25 insertions(+), 10 deletions(-) create mode 100644 db/versions/11312-navyAralia/00-firstScript.sql diff --git a/db/versions/11245-turquoiseAnthurium/00-firstScript.sql b/db/versions/11245-turquoiseAnthurium/00-firstScript.sql index 6381f5db4..f1c4d9471 100644 --- a/db/versions/11245-turquoiseAnthurium/00-firstScript.sql +++ b/db/versions/11245-turquoiseAnthurium/00-firstScript.sql @@ -1,15 +1,15 @@ -ALTER TABLE vn.workerRelatives DROP FOREIGN KEY workerRelatives_disabilityGradeFk; -ALTER TABLE vn.workerRelatives DROP FOREIGN KEY workerRelatives_workerFk; +-- ALTER TABLE vn.workerRelatives DROP FOREIGN KEY workerRelatives_disabilityGradeFk; +-- ALTER TABLE vn.workerRelatives DROP FOREIGN KEY workerRelatives_workerFk; -RENAME TABLE `vn`.`workerRelatives` TO `vn`.`workerRelative`; +-- RENAME TABLE `vn`.`workerRelatives` TO `vn`.`workerRelative`; -ALTER TABLE vn.workerRelative ADD CONSTRAINT `workerRelatives_disabilityGradeFk` FOREIGN KEY (`disabilityGradeFk`) REFERENCES `disabilityGrade` (`id`) ON UPDATE CASCADE; -ALTER TABLE vn.workerRelative ADD CONSTRAINT `workerRelatives_workerFk` FOREIGN KEY (`workerFk`) REFERENCES `workerIrpf` (`workerFk`) ON DELETE CASCADE ON UPDATE CASCADE; +-- ALTER TABLE vn.workerRelative ADD CONSTRAINT `workerRelatives_disabilityGradeFk` FOREIGN KEY (`disabilityGradeFk`) REFERENCES `disabilityGrade` (`id`) ON UPDATE CASCADE; +-- ALTER TABLE vn.workerRelative ADD CONSTRAINT `workerRelatives_workerFk` FOREIGN KEY (`workerFk`) REFERENCES `workerIrpf` (`workerFk`) ON DELETE CASCADE ON UPDATE CASCADE; -INSERT INTO salix.ACL (model,property,accessType,permission,principalType,principalId) - VALUES - ('Worker','workerRelative','*','ALLOW','ROLE','hr'), - ('Worker','workerIrpf','*','ALLOW','ROLE','hr'), - ('Worker','disabilityGrade','*','ALLOW','ROLE','hr'); +-- INSERT INTO salix.ACL (model,property,accessType,permission,principalType,principalId) +-- VALUES +-- ('workerRelative','*','*','ALLOW','ROLE','hr'), +-- ('workerIrpf','*','*','ALLOW','ROLE','hr'), +-- ('disabilityGrade','*','*','ALLOW','ROLE','hr'); diff --git a/db/versions/11312-navyAralia/00-firstScript.sql b/db/versions/11312-navyAralia/00-firstScript.sql new file mode 100644 index 000000000..0d58503bb --- /dev/null +++ b/db/versions/11312-navyAralia/00-firstScript.sql @@ -0,0 +1,15 @@ +ALTER TABLE vn.workerRelatives DROP FOREIGN KEY workerRelatives_disabilityGradeFk; +ALTER TABLE vn.workerRelatives DROP FOREIGN KEY workerRelatives_workerFk; + +-- RENAME TABLE `vn`.`workerRelatives` TO `vn`.`workerRelative`; + +-- ALTER TABLE vn.workerRelative ADD CONSTRAINT `workerRelatives_disabilityGradeFk` FOREIGN KEY (`disabilityGradeFk`) REFERENCES `disabilityGrade` (`id`) ON UPDATE CASCADE; +-- ALTER TABLE vn.workerRelative ADD CONSTRAINT `workerRelatives_workerFk` FOREIGN KEY (`workerFk`) REFERENCES `workerIrpf` (`workerFk`) ON DELETE CASCADE ON UPDATE CASCADE; + + +INSERT INTO salix.ACL (model,property,accessType,permission,principalType,principalId) + VALUES + ('workerRelatives','*','*','ALLOW','ROLE','hr'), + ('workerIrpf','*','*','ALLOW','ROLE','hr'), + ('disabilityGrade','*','*','ALLOW','ROLE','hr'); +