feat: refs #7685 chages required
gitea/salix/pipeline/pr-dev This commit looks good Details

This commit is contained in:
Robert Ferrús 2024-07-11 10:23:31 +02:00
parent 85a8009034
commit b3a98226c0
3 changed files with 4 additions and 8 deletions

View File

@ -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)
@ -13,18 +13,14 @@ BEGIN
*/
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 ;

View File

@ -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$$

View File

@ -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$$