Browse Source
The migration 003_active_identity_and_seed_backup was failing on iOS when switching from master to active_did_redux branch because it attempted to execute multiple SQL operations in a single block. When the ALTER TABLE statement for hasBackedUpSeed failed (due to column already existing), the entire migration was marked as "already applied" even though the active_identity table was never created. Changes: - Split migration 003 into two separate migrations: - 003_active_identity_and_seed_backup: Creates active_identity table - 003b_add_hasBackedUpSeed_to_settings: Adds hasBackedUpSeed column - Added data migration logic to copy existing activeDid from settings to active_identity table during migration - Added debug logging to track migration results - Ensured atomic operations so table creation doesn't depend on column addition This fix ensures that: - The active_identity table is always created successfully - Existing activeDid values are preserved during migration - The app remembers the active identity between master and active_did_redux builds - Migration errors are handled gracefully without affecting other operations Fixes iOS migration issue where app would lose active identity state when switching between branches, causing users to lose their selected identity and requiring manual re-selection. Tested: Migration now works correctly on iOS simulator when switching from master branch (with old schema) to active_did_redux branch.pull/188/head
1 changed files with 21 additions and 4 deletions
Loading…
Reference in new issue