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

Migration 20231205143526_remove_deployments_with_degenerate.rb might fail #3592

Closed
johha opened this issue Jan 10, 2024 · 1 comment
Closed

Comments

@johha
Copy link
Contributor

johha commented Jan 10, 2024

Content from #3538 (comment) @ChrisMcGowan :

The migration script when it fires runs into the following error:

[2024-01-09 18:20:21+0000] Sequel::ForeignKeyConstraintViolation: PG::ForeignKeyViolation: ERROR:  update or delete on table "deployments" violates foreign key constraint "fk_deployment_processes_deployment_guid" on table "deployment_processes" (Sequel::ForeignKeyConstraintViolation)
[2024-01-09 18:20:21+0000] DETAIL:  Key (guid)=(<app guid scrubbed>) is still referenced from table "deployment_processes".

We have over 31K rows in deployments and by count over 7,500 rows marked for delete with this migration script. Going back in this repo we found the initial framework for this in this migration script from here back in 2018.

This appears to be deleting the parent record but not the child records since a "cascade" delete is not taking place.

@philippthun
Copy link
Member

Fixed with #3596.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants