Merge pull request '2672-trigger_itemTag' (#509) from 2672-trigger_itemTag into dev
gitea/salix/pipeline/head This commit looks good Details

Reviewed-on: #509
Reviewed-by: Javi Gallego <jgallego@verdnatura.es>
This commit is contained in:
Bernat Exposito 2021-01-13 07:33:55 +00:00
commit b1613871e1
1 changed files with 19 additions and 0 deletions

View File

@ -0,0 +1,19 @@
DROP TRIGGER IF EXISTS `vn`.`itemTag_afterUpdate`;
DELIMITER $$
USE `vn`$$
CREATE DEFINER=`root`@`%` TRIGGER `vn`.`itemTag_afterUpdate`
AFTER UPDATE ON `itemTag` FOR EACH ROW
trig: BEGIN
IF @isTriggerDisabled THEN
LEAVE trig;
END IF;
DROP TEMPORARY TABLE IF EXISTS tmp.item;
CREATE TEMPORARY TABLE tmp.item
SELECT NEW.itemFk id;
CALL item_refreshTags();
DROP TEMPORARY TABLE tmp.item;
END$$
DELIMITER ;