From d6524cbd4390f0fe9bb51aae12853bfd53e788d5 Mon Sep 17 00:00:00 2001 From: Trent Larson Date: Wed, 24 Sep 2025 19:29:28 -0600 Subject: [PATCH] fix: don't lose the name when running the migration --- src/db-sql/migration.ts | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/db-sql/migration.ts b/src/db-sql/migration.ts index 81b3d913..f686d155 100644 --- a/src/db-sql/migration.ts +++ b/src/db-sql/migration.ts @@ -68,18 +68,18 @@ const MIG_004_SQL = ` WHERE id = 1 AND EXISTS (SELECT 1 FROM settings WHERE id = 1 AND activeDid IS NOT NULL AND activeDid != ''); - -- Copy important settings that were set in the MASTER_SETTINGS_KEY to all the other identities. + -- Copy important settings that were set in the MASTER_SETTINGS_KEY to the main identity. -- (We're not doing them all because some were already identity-specific and others aren't as critical.) UPDATE settings - SET firstName = (SELECT firstName FROM settings WHERE id = 1), - lastViewedClaimId = (SELECT lastViewedClaimId FROM settings WHERE id = 1), + SET lastViewedClaimId = (SELECT lastViewedClaimId FROM settings WHERE id = 1), profileImageUrl = (SELECT profileImageUrl FROM settings WHERE id = 1), showShortcutBvc = (SELECT showShortcutBvc FROM settings WHERE id = 1), warnIfProdServer = (SELECT warnIfProdServer FROM settings WHERE id = 1), - warnIfTestServer = (SELECT warnIfTestServer FROM settings WHERE id = 1); + warnIfTestServer = (SELECT warnIfTestServer FROM settings WHERE id = 1) + WHERE id = 2; -- CLEANUP: Remove orphaned settings records and clear legacy activeDid values - -- which usually simply clears out the MASTER_SETTINGS_KEY record. + -- which usually simply deletes the MASTER_SETTINGS_KEY record. -- This completes the migration from settings-based to table-based active identity DELETE FROM settings WHERE accountDid IS NULL; UPDATE settings SET activeDid = NULL;