From 8b3af8851ccf05f69d7be1773aaef64160e81d90 Mon Sep 17 00:00:00 2001 From: bernat Date: Mon, 11 Jan 2021 11:29:47 +0100 Subject: [PATCH 1/2] fix trigger itemTag --- db/changes/12270-wisemen/00-itemTag.sql | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 db/changes/12270-wisemen/00-itemTag.sql diff --git a/db/changes/12270-wisemen/00-itemTag.sql b/db/changes/12270-wisemen/00-itemTag.sql new file mode 100644 index 000000000..9762314f5 --- /dev/null +++ b/db/changes/12270-wisemen/00-itemTag.sql @@ -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 vItem id; + + CALL item_refreshTags(); + DROP TEMPORARY TABLE tmp.item; +END$$ +DELIMITER ; \ No newline at end of file -- 2.40.1 From 975e158ebbea62e7ef23935480f18a2356639403 Mon Sep 17 00:00:00 2001 From: bernat Date: Wed, 13 Jan 2021 08:17:41 +0100 Subject: [PATCH 2/2] itemTag trigger --- db/changes/12270-wisemen/00-itemTag.sql | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/db/changes/12270-wisemen/00-itemTag.sql b/db/changes/12270-wisemen/00-itemTag.sql index 9762314f5..f1e9370d5 100644 --- a/db/changes/12270-wisemen/00-itemTag.sql +++ b/db/changes/12270-wisemen/00-itemTag.sql @@ -11,7 +11,7 @@ trig: BEGIN DROP TEMPORARY TABLE IF EXISTS tmp.item; CREATE TEMPORARY TABLE tmp.item - SELECT vItem id; + SELECT NEW.itemFk id; CALL item_refreshTags(); DROP TEMPORARY TABLE tmp.item; -- 2.40.1