Skip to content

Commit

Permalink
add a WHEN condition to avoid unwanted trigger execution
Browse files Browse the repository at this point in the history
  • Loading branch information
dferhod committed Jun 19, 2024
1 parent f4a2bba commit ce2259e
Showing 1 changed file with 1 addition and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -243,6 +243,7 @@ $$ LANGUAGE plpgsql;
CREATE TRIGGER on_upsert_entity_preview_fk_class
AFTER INSERT OR UPDATE OF fk_class ON pgwar.entity_preview
FOR EACH ROW
WHEN (NEW.fk_project IS DISTINCT FROM 0)
EXECUTE FUNCTION pgwar.update_entity_label_on_fk_class_change();

-- Update entity labels of related entities, on change on entity preview entity_label
Expand Down

0 comments on commit ce2259e

Please sign in to comment.