salix/db/routines/hedera/triggers/news_afterUpdate.sql

12 lines
277 B
MySQL
Raw Normal View History

DELIMITER $$
CREATE OR REPLACE DEFINER=`root`@`localhost` TRIGGER `hedera`.`news_afterUpdate`
AFTER UPDATE ON `news`
FOR EACH ROW
BEGIN
IF !(NEW.image <=> OLD.image) THEN
CALL image_unref('news', OLD.image);
CALL image_ref('news', NEW.image);
END IF;
END$$
DELIMITER ;