Skip to content

Commit a8db546

Browse files
lklimekclaude
andcommitted
fix(db): remove redundant wallet column additions from v33 migration
The v16/v17 migration steps already add these columns sequentially before v33 runs. The idempotent re-add in v33 was unnecessary — any database reaching v33 has already passed through v16 and v17. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 7a73f09 commit a8db546

1 file changed

Lines changed: 3 additions & 9 deletions

File tree

src/database/initialization.rs

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,9 @@ impl Database {
2727
// NOTE: ensure_wallet_columns_exist() used to run here, but it
2828
// ALTERs wallet_addresses which triggers FK re-validation on
2929
// orphaned rows before our migration cleanup has a chance to run.
30-
// Those column additions (v16 balance cols, v17 total_received)
31-
// are now covered idempotently inside the v33 migration step,
32-
// after clean_orphaned_fk_rows().
30+
// Removed: those columns are added by their own migration steps
31+
// (v16 balance cols, v17 total_received) which run sequentially
32+
// before v33, so they always exist by the time v33 executes.
3333
}
3434

3535
// Check if this is the first time setup by looking for entries in the settings table.
@@ -67,12 +67,6 @@ impl Database {
6767
// so this is safe to run on any DB that already applied some or all
6868
// of the individual steps.
6969
self.clean_orphaned_fk_rows(tx)?;
70-
// Wallet column additions formerly in ensure_wallet_columns_exist().
71-
// Moved here so they run after orphan cleanup (ALTER TABLE on
72-
// wallet_addresses triggers FK re-validation on orphaned rows).
73-
// Idempotent — safe if columns already exist from v16/v17.
74-
self.add_wallet_balance_columns(tx)?;
75-
self.add_address_total_received_column(tx)?;
7670
self.add_core_wallet_name_column(tx)?;
7771
self.init_contacts_tables(tx)?;
7872
self.create_shielded_tables(tx)?;

0 commit comments

Comments
 (0)