Skip to content

wallet: create bwatch tables before backfilling them - #9742

Merged
nGoline merged 1 commit into
ElementsProject:masterfrom
daywalker90:fix/bwatch-migration-284
Nov 17, 2026
Merged

nGoline merged 1 commit into
ElementsProject:masterfrom
daywalker90:fix/bwatch-migration-284

Conversation

@daywalker90

@daywalker90 daywalker90 commented Nov 17, 2026 •

Copy link
Copy Markdown
Collaborator

Databases from v26.06.10 are at migration version 284 and never ran the our_outputs/our_txs CREATE TABLE migrations, which master placed at indices 283/284. On upgrade, migrate_backfill_bwatch_tables (index 285) then inserts into our_outputs and fails with "no such table".

Create both tables with IF NOT EXISTS at the start of the backfill, so it works whether or not the earlier CREATEs ran. Existing databases already have the tables, so this is a no-op for them.

Add a unit test that starts from a v26.06.10-shaped database without the bwatch tables.

Fixes: #9608

Changelog-None

Databases from v26.06.10 are at migration version 284 and never ran the
our_outputs/our_txs CREATE TABLE migrations, which master placed at
indices 283/284. On upgrade, migrate_backfill_bwatch_tables (index 285)
then inserts into our_outputs and fails with "no such table".

Create both tables with IF NOT EXISTS at the start of the backfill, so it
works whether or not the earlier CREATEs ran. Existing databases already
have the tables, so this is a no-op for them.

Add a unit test that starts from a v26.06.10-shaped database without the
bwatch tables.
@daywalker90 daywalker90 added this to the v26.12 milestone Nov 17, 2026
@daywalker90 daywalker90 mentioned this pull request Nov 17, 2026

@sangbida sangbida left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is awesome!

@nGoline nGoline left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ack e959518

Will merge as soon as the CI goes green

@nGoline
nGoline enabled auto-merge (rebase) November 17, 2026 11:34
@nGoline
nGoline merged commit ce2a683 into ElementsProject:master Nov 17, 2026
57 of 59 checks passed
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.

Database migration broken during migration to master

3 participants