Skip to content

Conversation

nikclayton
Copy link
Contributor

The 10 -> 11 database migration adds FK constraints with AccountEntity.id as the parent.

Because of previous bugs there may be orphaned data in some tables that references accounts that no longer exist in AccountEntity. This causes a crash during migration.

This migration was previously automatic. Rewrite it to be manual, by copying the code that was previously generated and inserting explcit DELETE statements ahead of the migration to remove the orphaned rows.

Fixes #1320

The 10 -> 11 database migration adds FK constraints with
`AccountEntity.id` as the parent.

Because of previous bugs there may be orphaned data in some tables that
references accounts that no longer exist in `AccountEntity`. This causes
a crash during migration.

This migration was previously automatic. Rewrite it to be manual, by
copying the code that was previously generated and inserting explcit
`DELETE` statements ahead of the migration to remove the orphaned rows.

Fixes pachli#1320
@nikclayton nikclayton merged commit ab18f46 into pachli:main Mar 1, 2025
27 checks passed
@nikclayton nikclayton deleted the delete-missing-accounts-in-migration branch March 1, 2025 16:06
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

Successfully merging this pull request may close these issues.

Pachli 2.10.0 keeps stopping
2 participants