salix/db/changes/10071-coffee/00-ticketAfterUpdate.sql

15 lines
400 B
MySQL
Raw Normal View History

DROP TRIGGER IF EXISTS `vn2008`.`ticket_afterUpdate`;
DELIMITER $$
CREATE DEFINER=`root`@`%` TRIGGER `vn2008`.`ticket_afterUpdate`
AFTER UPDATE ON `Tickets`
FOR EACH ROW
BEGIN
IF !(NEW.Id_Ticket <=> OLD.Id_Ticket)
OR !(NEW.warehouse_id <=> OLD.warehouse_id)
OR !(NEW.Fecha <=> OLD.Fecha) THEN
CALL stock.log_add('ticket', NEW.Id_Ticket, OLD.Id_Ticket);
END IF;
END$$
DELIMITER ;