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

14 lines
384 B
SQL

DELIMITER $$
CREATE OR REPLACE DEFINER=`root`@`localhost` TRIGGER `vn`.`ticketService_afterUpdate`
AFTER UPDATE ON `ticketService`
FOR EACH ROW
BEGIN
IF !(NEW.price <=> OLD.price)
OR !(NEW.ticketFk <=> OLD.ticketFk)
OR !(NEW.quantity <=> OLD.quantity) THEN
CALL ticket_requestRecalc(NEW.ticketFk);
CALL ticket_requestRecalc(OLD.ticketFk);
END IF;
END$$
DELIMITER ;