From 61ed53bd1d75f3bbc0e0478231a2c60b8033aba6 Mon Sep 17 00:00:00 2001 From: sergiodt Date: Thu, 7 Dec 2023 10:37:06 +0100 Subject: [PATCH] REFS #6275 feat:Silex_to_Salix --- db/changes/235001/00-silexToSalix.sql | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/db/changes/235001/00-silexToSalix.sql b/db/changes/235001/00-silexToSalix.sql index 362b967cc..bad430ac2 100644 --- a/db/changes/235001/00-silexToSalix.sql +++ b/db/changes/235001/00-silexToSalix.sql @@ -5,7 +5,7 @@ CREATE OR REPLACE DEFINER=`root`@`localhost` TRIGGER `vn`.`delivery_beforeInsert FOR EACH ROW BEGIN - IF (NEW.ticketFk IS NOT NULL) + IF (NEW.longitude IS NOT NULL AND NEW.latitude IS NOT NULL AND NEW.ticketFK IS NOT NULL) THEN UPDATE address SET longitude = NEW.longitude, @@ -26,7 +26,7 @@ CREATE OR REPLACE DEFINER=`root`@`localhost` TRIGGER `vn`.`delivery_beforeUpdate FOR EACH ROW BEGIN -IF (NEW.longitude <> OLD.longitude OR NEW.latitude <> OLD.latitude OR NEW.ticketFk <> OLD.ticketFk) +IF (NEW.longitude IS NOT NULL AND NEW.latitude IS NOT NULL AND NEW.ticketFK IS NOT NULL) THEN UPDATE address SET longitude = NEW.longitude,