Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add ON DELETE CASCADE to workflow tables #13165

Merged
merged 1 commit into from
May 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/tame-mice-give.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"chainlink": patch
---

#db_update Add ON DELETE CASCADE to workflow tables
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
-- +goose Up
-- +goose StatementBegin
ALTER TABLE workflow_executions
DROP CONSTRAINT workflow_executions_workflow_id_fkey,
ADD CONSTRAINT workflow_executions_workflow_id_fkey
FOREIGN KEY (workflow_id)
REFERENCES workflow_specs(workflow_id)
ON DELETE CASCADE;

ALTER TABLE workflow_steps
DROP CONSTRAINT workflow_steps_workflow_execution_id_fkey,
ADD CONSTRAINT workflow_steps_workflow_execution_id_fkey
FOREIGN KEY (workflow_execution_id)
REFERENCES workflow_executions(id)
ON DELETE CASCADE;
-- +goose StatementEnd

-- +goose Down
-- +goose StatementBegin
ALTER TABLE workflow_executions
DROP CONSTRAINT workflow_executions_workflow_id_fkey,
ADD CONSTRAINT workflow_executions_workflow_id_fkey
FOREIGN KEY (workflow_id)
REFERENCES workflow_specs(workflow_id);

ALTER TABLE workflow_steps
DROP CONSTRAINT workflow_steps_workflow_execution_id_fkey,
ADD CONSTRAINT workflow_steps_workflow_execution_id_fkey
FOREIGN KEY (workflow_execution_id)
REFERENCES workflow_executions(id);
-- +goose StatementEnd
Loading