salix/db/routines/vn/triggers/delivery_beforeInsert.sql

13 lines
343 B
MySQL
Raw Normal View History

2024-01-25 16:33:54 +00:00
DELIMITER $$
CREATE OR REPLACE DEFINER=`root`@`localhost` TRIGGER `vn`.`delivery_beforeInsert`
BEFORE INSERT ON `delivery`
FOR EACH ROW
BEGIN
2024-07-09 08:01:32 +00:00
IF (NEW.longitude IS NOT NULL AND NEW.latitude IS NOT NULL AND NEW.ticketFK IS NOT NULL) THEN
2024-07-11 08:23:31 +00:00
CALL address_updateCoordinates(NEW.ticketFk,NEW.longitude,NEW.latitude);
2024-01-25 16:33:54 +00:00
END IF;
END$$
DELIMITER ;