From b5d883cdbeb742187a923ca70ca12f1923cb4714 Mon Sep 17 00:00:00 2001 From: Javier Segarra Date: Tue, 23 Jan 2024 11:53:12 +0100 Subject: [PATCH] refs #2687 feat: add grant privileges for guest --- db/changes/240601/00-grant_privileges_util_tx.sql | 3 +++ db/changes/240601/00-util_tx_commit.sql | 4 +--- db/changes/240601/00-util_tx_rollback.sql | 4 +--- db/changes/240601/00-util_tx_start.sql | 4 ++-- 4 files changed, 7 insertions(+), 8 deletions(-) create mode 100644 db/changes/240601/00-grant_privileges_util_tx.sql diff --git a/db/changes/240601/00-grant_privileges_util_tx.sql b/db/changes/240601/00-grant_privileges_util_tx.sql new file mode 100644 index 000000000..bd49f6cb2 --- /dev/null +++ b/db/changes/240601/00-grant_privileges_util_tx.sql @@ -0,0 +1,3 @@ +GRANT EXECUTE ON PROCEDURE util.tx_commit TO guest; +GRANT EXECUTE ON PROCEDURE util.tx_rollback TO guest; +GRANT EXECUTE ON PROCEDURE util.tx_start TO guest; diff --git a/db/changes/240601/00-util_tx_commit.sql b/db/changes/240601/00-util_tx_commit.sql index 47e782987..f288e5fe3 100644 --- a/db/changes/240601/00-util_tx_commit.sql +++ b/db/changes/240601/00-util_tx_commit.sql @@ -1,5 +1,3 @@ -DROP PROCEDURE IF EXISTS util.tx_commit; - DELIMITER $$ $$ /** @@ -8,7 +6,7 @@ $$ * @param tx BOOL es true si existe transacción asociada */ -CREATE DEFINER=`root`@`localhost` PROCEDURE `util`.`tx_commit`(IN tx BOOL) +CREATE OR REPLACE DEFINER=`root`@`localhost` PROCEDURE `util`.`tx_commit`(IN tx BOOL) BEGIN IF tx THEN COMMIT; diff --git a/db/changes/240601/00-util_tx_rollback.sql b/db/changes/240601/00-util_tx_rollback.sql index 1a79479be..3ec738fa7 100644 --- a/db/changes/240601/00-util_tx_rollback.sql +++ b/db/changes/240601/00-util_tx_rollback.sql @@ -1,5 +1,3 @@ -DROP PROCEDURE IF EXISTS util.tx_rollback; - DELIMITER $$ $$ /** @@ -8,7 +6,7 @@ $$ * @param tx BOOL es true si existe transacción asociada */ -CREATE DEFINER=`root`@`localhost` PROCEDURE `util`.`tx_rollback`(tx BOOL) +CREATE OR REPLACE DEFINER=`root`@`localhost` PROCEDURE `util`.`tx_rollback`(tx BOOL) BEGIN IF tx THEN ROLLBACK; diff --git a/db/changes/240601/00-util_tx_start.sql b/db/changes/240601/00-util_tx_start.sql index 22d156642..f4a970c4f 100644 --- a/db/changes/240601/00-util_tx_start.sql +++ b/db/changes/240601/00-util_tx_start.sql @@ -1,4 +1,4 @@ -DROP PROCEDURE IF EXISTS util.tx_start; + DELIMITER $$ $$ @@ -8,7 +8,7 @@ $$ * @param tx BOOL es true si existe transacción asociada */ -CREATE DEFINER=`root`@`localhost` PROCEDURE `util`.`tx_start`(tx BOOL) +CREATE OR REPLACE DEFINER=`root`@`localhost` PROCEDURE `util`.`tx_start`(tx BOOL) BEGIN IF tx THEN START TRANSACTION;