Skip to content

fix: Ensure database migrations work when upgrading from very old versions#2129

Merged
nikclayton merged 1 commit intopachli:mainfrom
nikclayton:db-migration
Feb 20, 2026
Merged

fix: Ensure database migrations work when upgrading from very old versions#2129
nikclayton merged 1 commit intopachli:mainfrom
nikclayton:db-migration

Conversation

@nikclayton
Copy link
Copy Markdown
Contributor

Switching to bundled SQLite means that if the user is upgrading from a prior version that has a database migration the migration has to be re-written to use the bundled SQLite (migrations are run with whatever database driver is active now, not whatever database driver was used when the migration was written).

So all the onPostMigrate and migrate functions have to take SQLiteConnection as a parameter and be re-written to use that where necessary.

If this isn't done then (a) all the onPostMigrate functions are skipped, and (b) any migrate functions will throw an exception.

Fixes #2119, #2062

…sions

Switching to bundled SQLite means that if the user is upgrading from a prior
version that has a database migration the migration has to be re-written to
use the bundled SQLite (migrations are run with whatever database driver is
active now, not whatever database driver was used when the migration was
written).

So all the `onPostMigrate` and `migrate` functions have to take
`SQLiteConnection` as a parameter and be re-written to use that where
necessary.

If this isn't done then (a) all the `onPostMigrate` functions are skipped,
and (b) any `migrate` functions will throw an exception.

Fixes pachli#2119, pachli#2062
@nikclayton nikclayton merged commit f82d0e1 into pachli:main Feb 20, 2026
27 checks passed
@nikclayton nikclayton deleted the db-migration branch February 20, 2026 22:40
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 3.3.x crashes immediately after start

1 participant