This commit is contained in:
parent
3692021b12
commit
61ed53bd1d
|
@ -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,
|
||||
|
|
Loading…
Reference in New Issue