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

11 lines
324 B
SQL

DELIMITER $$
CREATE OR REPLACE DEFINER=`root`@`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 ;