From b3a98226c082548f1715c861b3f3c44400562404 Mon Sep 17 00:00:00 2001 From: robert Date: Thu, 11 Jul 2024 10:23:31 +0200 Subject: [PATCH] feat: refs #7685 chages required --- ...dateCorordinates.sql => address_updateCoordinates.sql} | 8 ++------ db/routines/vn/triggers/delivery_beforeInsert.sql | 2 +- db/routines/vn/triggers/delivery_beforeUpdate.sql | 2 +- 3 files changed, 4 insertions(+), 8 deletions(-) rename db/routines/vn/procedures/{address_updateCorordinates.sql => address_updateCoordinates.sql} (84%) diff --git a/db/routines/vn/procedures/address_updateCorordinates.sql b/db/routines/vn/procedures/address_updateCoordinates.sql similarity index 84% rename from db/routines/vn/procedures/address_updateCorordinates.sql rename to db/routines/vn/procedures/address_updateCoordinates.sql index 2004cd180..0b734e9d7 100644 --- a/db/routines/vn/procedures/address_updateCorordinates.sql +++ b/db/routines/vn/procedures/address_updateCoordinates.sql @@ -1,5 +1,5 @@ DELIMITER $$ -CREATE OR REPLACE DEFINER=`root`@`localhost` PROCEDURE `vn`.`address_updateCorordinates`( +CREATE OR REPLACE DEFINER=`root`@`localhost` PROCEDURE `vn`.`address_updateCoordinates`( vTicketFk INT, vLongitude INT, vLatitude INT) @@ -12,19 +12,15 @@ BEGIN * @param vLatitude latitud de la dirrecion */ DECLARE vAddressFK INT; - - START TRANSACTION; SELECT addressFK INTO vAddressFK FROM ticket - WHERE id = vTicketFk - FOR UPDATE; + WHERE id = vTicketFk; UPDATE address SET longitude = vLongitude, latitude = vLatitude WHERE id = vAddressFK; - COMMIT; END$$ DELIMITER ; diff --git a/db/routines/vn/triggers/delivery_beforeInsert.sql b/db/routines/vn/triggers/delivery_beforeInsert.sql index c9679ed13..241015261 100644 --- a/db/routines/vn/triggers/delivery_beforeInsert.sql +++ b/db/routines/vn/triggers/delivery_beforeInsert.sql @@ -5,7 +5,7 @@ CREATE OR REPLACE DEFINER=`root`@`localhost` TRIGGER `vn`.`delivery_beforeInsert BEGIN IF (NEW.longitude IS NOT NULL AND NEW.latitude IS NOT NULL AND NEW.ticketFK IS NOT NULL) THEN - CALL address_updateCorordinates(NEW.ticketFk,NEW.longitude,NEW.latitude); + CALL address_updateCoordinates(NEW.ticketFk,NEW.longitude,NEW.latitude); END IF; END$$ diff --git a/db/routines/vn/triggers/delivery_beforeUpdate.sql b/db/routines/vn/triggers/delivery_beforeUpdate.sql index dda0e9dd2..264591951 100644 --- a/db/routines/vn/triggers/delivery_beforeUpdate.sql +++ b/db/routines/vn/triggers/delivery_beforeUpdate.sql @@ -5,7 +5,7 @@ CREATE OR REPLACE DEFINER=`root`@`localhost` TRIGGER `vn`.`delivery_beforeUpdate BEGIN IF (NEW.longitude IS NOT NULL AND NEW.latitude IS NOT NULL AND NEW.ticketFK IS NOT NULL) THEN - CALL address_updateCorordinates(NEW.ticketFk,NEW.longitude,NEW.latitude); + CALL address_updateCoordinates(NEW.ticketFk,NEW.longitude,NEW.latitude); END IF; END$$