From b7bb1b97847885c24502645a9f01c9454014536f Mon Sep 17 00:00:00 2001 From: davidd Date: Tue, 6 Feb 2024 07:37:33 +0100 Subject: [PATCH] refs #6372 feat: vn2008 to vn --- db/routines/vn2008/views/link.sql | 8 -------- db/versions/10836-limeCordyline/09-link.sql | 11 ----------- db/versions/10836-limeCordyline/29-kk.sql | 3 +++ db/versions/10836-limeCordyline/30-permissions.sql | 12 ++++-------- 4 files changed, 7 insertions(+), 27 deletions(-) delete mode 100644 db/routines/vn2008/views/link.sql delete mode 100644 db/versions/10836-limeCordyline/09-link.sql diff --git a/db/routines/vn2008/views/link.sql b/db/routines/vn2008/views/link.sql deleted file mode 100644 index f5fb9bd2b..000000000 --- a/db/routines/vn2008/views/link.sql +++ /dev/null @@ -1,8 +0,0 @@ -CREATE OR REPLACE DEFINER=`root`@`localhost` - SQL SECURITY DEFINER - VIEW `vn2008`.`link` -AS SELECT - `l`.`clientFk` AS `Id_Cliente`, - `l`.`supplierFk` AS `Id_Proveedor` -FROM - `vn`.`link` `l`; \ No newline at end of file diff --git a/db/versions/10836-limeCordyline/09-link.sql b/db/versions/10836-limeCordyline/09-link.sql deleted file mode 100644 index a1a671270..000000000 --- a/db/versions/10836-limeCordyline/09-link.sql +++ /dev/null @@ -1,11 +0,0 @@ -ALTER TABLE IF EXISTS `vn2008`.`link` RENAME `vn`.`link`; - -ALTER TABLE IF EXISTS `vn`.`link` -CHANGE COLUMN IF EXISTS `Id_Cliente` `clientFk` int(11) NOT NULL, -CHANGE COLUMN IF EXISTS `Id_Proveedor` `supplierFk` int(11) NOT NULL; - -ALTER TABLE IF EXISTS vn.link MODIFY COLUMN supplierFk int(10) unsigned NOT NULL; - -ALTER TABLE IF EXISTS vn.link ADD CONSTRAINT link_client_FK FOREIGN KEY (clientFk) REFERENCES vn.client(id) ON DELETE CASCADE ON UPDATE CASCADE; -ALTER TABLE IF EXISTS vn.link ADD CONSTRAINT link_supplier_FK FOREIGN KEY (supplierFk) REFERENCES vn.supplier(id) ON DELETE CASCADE ON UPDATE CASCADE; - diff --git a/db/versions/10836-limeCordyline/29-kk.sql b/db/versions/10836-limeCordyline/29-kk.sql index c21980da9..9ec27358f 100644 --- a/db/versions/10836-limeCordyline/29-kk.sql +++ b/db/versions/10836-limeCordyline/29-kk.sql @@ -153,3 +153,6 @@ ALTER TABLE IF EXISTS vn2008.jerarquia__ COMMENT='refs #6372 @deprecated 2023-12 ALTER TABLE IF EXISTS vn2008.language RENAME vn2008.language__; ALTER TABLE IF EXISTS vn2008.language__ COMMENT='refs #6372 @deprecated 2023-12-13;'; + +ALTER TABLE IF EXISTS vn2008.link RENAME vn2008.link__; +ALTER TABLE IF EXISTS vn2008.link__ COMMENT='refs #6372 @deprecated 2023-12-13;'; diff --git a/db/versions/10836-limeCordyline/30-permissions.sql b/db/versions/10836-limeCordyline/30-permissions.sql index c27ee1e88..fd7c6c58e 100644 --- a/db/versions/10836-limeCordyline/30-permissions.sql +++ b/db/versions/10836-limeCordyline/30-permissions.sql @@ -13,14 +13,10 @@ VIEW `vn2008`.`integra2_province` AS GRANT SELECT ON TABLE vn2008.integra2_province TO `employee`; GRANT SELECT ON TABLE vn.integra2Province TO `employee`; -- link -CREATE OR REPLACE DEFINER=`root`@`localhost` - SQL SECURITY DEFINER -VIEW `vn2008`.`link` AS - SELECT 1; -GRANT SELECT ON TABLE vn2008.link TO `administrative`; -GRANT SELECT ON TABLE vn.link TO `administrative`; -GRANT SELECT ON TABLE vn2008.link TO `hr`; -GRANT SELECT ON TABLE vn.link TO `hr`; + +GRANT SELECT ON TABLE vn.company TO `administrative`; +GRANT SELECT ON TABLE vn.company TO `hr`; + -- warehouse_pickup CREATE OR REPLACE DEFINER=`root`@`localhost` SQL SECURITY DEFINER