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

13 lines
275 B
MySQL
Raw Normal View History

DELIMITER $$
CREATE OR REPLACE DEFINER=`root`@`localhost` TRIGGER `vn`.`ticket_afterUpdate`
AFTER UPDATE ON `ticket`
FOR EACH ROW
BEGIN
IF NEW.routeFk <> OLD.routeFk THEN
UPDATE expedition
SET hasNewRoute = TRUE
WHERE ticketFk = NEW.id;
END IF;
END$$
DELIMITER ;