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

17 lines
338 B
MySQL
Raw Permalink Normal View History

DELIMITER $$
2024-08-20 08:06:10 +00:00
CREATE OR REPLACE DEFINER=`vn`@`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;
2024-06-05 11:42:21 +00:00
IF NEW.cmrFk THEN
CALL ticket_doCmr(NEW.id);
END IF;
END IF;
END$$
DELIMITER ;