Skip to content

fix(database): resolve migration failure and improve init safety#2165

Merged
jubalh merged 1 commit into
masterfrom
fix/2163
May 15, 2026
Merged

fix(database): resolve migration failure and improve init safety#2165
jubalh merged 1 commit into
masterfrom
fix/2163

Conversation

@jubalh

@jubalh jubalh commented May 15, 2026

Copy link
Copy Markdown
Member

Ensure the DbVersion table contains exactly one row during migrations by using DELETE and INSERT instead of UPDATE. This fixes issues where multiple version rows caused unique constraint failures and rolled back schema migrations.

Properly close the database on initialization failure to prevent subsequent operations on a broken state.

Initialize new databases with the latest schema version to avoid redundant migration attempts.

Fixes #2105

Ensure the DbVersion table contains exactly one row during migrations
by using DELETE and INSERT instead of UPDATE. This fixes issues where
multiple version rows caused unique constraint failures and rolled back
schema migrations.

Properly close the database on initialization failure to prevent
subsequent operations on a broken state.

Initialize new databases with the latest schema version to avoid
redundantmigration attempts.

Fixes #2105
Signed-off-by: Michael Vetter <jubalh@iodoru.org>
@jubalh jubalh added this to the next milestone May 15, 2026
@jubalh jubalh self-assigned this May 15, 2026
@mdosch

mdosch commented May 15, 2026

Copy link
Copy Markdown
Contributor

This fixed the DB issue for me.

@jubalh jubalh merged commit 32f0b7b into master May 15, 2026
12 checks passed
@jubalh jubalh deleted the fix/2163 branch May 15, 2026 11:15
@jubalh

jubalh commented May 15, 2026

Copy link
Copy Markdown
Member Author

I made a mistake in the issue number. This PR fixes #2163.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants