Skip to content

Commit

Permalink
fix: config.updated events
Browse files Browse the repository at this point in the history
  • Loading branch information
adityathebe committed Aug 29, 2024
1 parent 5d90228 commit 60d72fe
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion views/006_config_views.sql
Original file line number Diff line number Diff line change
Expand Up @@ -356,9 +356,12 @@ BEGIN
WHEN TG_OP = 'INSERT' THEN
event_name := 'config.created';
WHEN TG_OP = 'UPDATE' THEN
event_name := 'config.updated';
IF OLD.deleted_at IS NULL AND NEW.deleted_at IS NOT NULL THEN
event_name := 'config.deleted';
ELSIF OLD.config != NEW.config THEN
event_name := 'config.updated';
ELSE
RETURN NEW;
END IF;
ELSE
RAISE EXCEPTION 'Unexpected operation in trigger: %', TG_OP;
Expand Down

0 comments on commit 60d72fe

Please sign in to comment.