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

11 lines
328 B
MySQL
Raw Normal View History

DELIMITER $$
CREATE OR REPLACE DEFINER=`vn-admin`@`localhost` TRIGGER `vn`.`ektEntryAssign_afterUpdate`
AFTER UPDATE ON `ektEntryAssign`
FOR EACH ROW
BEGIN
IF NOT(NEW.`ref` <=> OLD.`ref`) OR NOT(NEW.`entryFk` <=> OLD.`entryFk`) THEN
UPDATE entry SET reference = NEW.`ref` WHERE id = NEW.entryFk;
END IF;
END$$
DELIMITER ;