forked from trent_larson/crowd-funder-for-time-pwa
Merge branch 'active_did_redux' of ssh://173.199.124.46:222/trent_larson/crowd-funder-for-time-pwa into active_did_redux
This commit is contained in:
@@ -65,6 +65,14 @@ Follow this implementation checklist step-by-step to complete the migration.
|
||||
|
||||
-- Insert default record (will be updated during migration)
|
||||
INSERT OR IGNORE INTO active_identity (id, activeDid, lastUpdated) VALUES (1, '', datetime('now'));
|
||||
|
||||
-- MIGRATE EXISTING DATA: Copy activeDid from settings to active_identity
|
||||
-- This prevents data loss when migration runs on existing databases
|
||||
UPDATE active_identity
|
||||
SET activeDid = (SELECT activeDid FROM settings WHERE id = 1),
|
||||
lastUpdated = datetime('now')
|
||||
WHERE id = 1
|
||||
AND EXISTS (SELECT 1 FROM settings WHERE id = 1 AND activeDid IS NOT NULL AND activeDid != '');
|
||||
`,
|
||||
},
|
||||
```
|
||||
@@ -282,11 +290,9 @@ async function migrateActiveDidToSeparateTable(): Promise<MigrationResult> {
|
||||
result.warnings.push(`Successfully migrated activeDid: ${activeDid}`);
|
||||
|
||||
} catch (error) {
|
||||
result.errors.push(`Migration failed: ${error}`);
|
||||
logger.error("[ActiveDid Migration] Critical error during migration:", error);
|
||||
logger.error("[PlatformServiceMixin] Error getting active identity:", error);
|
||||
throw error;
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
```
|
||||
|
||||
|
||||
Reference in New Issue
Block a user