14 lines
351 B
SQL
14 lines
351 B
SQL
DELIMITER $$
|
|
CREATE OR REPLACE DEFINER=`root`@`localhost` TRIGGER `vn`.`delivery_beforeUpdate`
|
|
BEFORE UPDATE ON `delivery`
|
|
FOR EACH ROW
|
|
BEGIN
|
|
IF (NEW.longitude IS NOT NULL
|
|
AND NEW.latitude IS NOT NULL
|
|
AND NEW.ticketFK IS NOT NULL)
|
|
THEN
|
|
CALL address_updateCoordinates(NEW.ticketFk, NEW.longitude, NEW.latitude);
|
|
END IF;
|
|
END$$
|
|
DELIMITER ;
|