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

12 lines
277 B
SQL

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 ;