Skip to content

Commit

Permalink
Updated to include deleted_at in whitelist and updated migration to c…
Browse files Browse the repository at this point in the history
…reate logidze snapshots for existing workflow executions
  • Loading branch information
deepsidhu85 committed Jan 9, 2025
1 parent 42f6b53 commit 72a8bbb
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ def change
reversible do |dir|
dir.up do
create_trigger :logidze_on_workflow_executions, on: :workflow_executions

execute <<-SQL.squish
UPDATE "workflow_executions" as t SET log_data = logidze_snapshot(to_jsonb(t), 'created_at', '{"run_id","name","state","deleted_at"}', true);
SQL
end

dir.down do
Expand Down
4 changes: 2 additions & 2 deletions db/schema.rb

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion db/triggers/logidze_on_workflow_executions_v01.sql
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ BEFORE UPDATE OR INSERT ON "workflow_executions" FOR EACH ROW
WHEN (coalesce(current_setting('logidze.disabled', true), '') <> 'on')
-- Parameters: history_size_limit (integer), timestamp_column (text), filtered_columns (text[]),
-- include_columns (boolean), debounce_time_ms (integer)
EXECUTE PROCEDURE logidze_logger(null, 'updated_at', '{run_id,name,state}', true);
EXECUTE PROCEDURE logidze_logger(null, 'updated_at', '{run_id,name,state,deleted_at}', true);

0 comments on commit 72a8bbb

Please sign in to comment.