From ef9b2dfc802f355460c388b01935e5d994d764c2 Mon Sep 17 00:00:00 2001 From: Audric Ackermann Date: Fri, 12 Aug 2022 15:28:07 +1000 Subject: [PATCH] fix: pass the db instance during db migration --- ts/node/migration/sessionMigrations.ts | 24 +++++++++++++++--------- 1 file changed, 15 insertions(+), 9 deletions(-) diff --git a/ts/node/migration/sessionMigrations.ts b/ts/node/migration/sessionMigrations.ts index 83991f247..298245656 100644 --- a/ts/node/migration/sessionMigrations.ts +++ b/ts/node/migration/sessionMigrations.ts @@ -978,11 +978,14 @@ function updateToSessionSchemaVersion27(currentVersion: number, db: BetterSqlite console.info( `withIpButNotDuplicateRoom: renaming room old:${r.conversationId} with saveV2OpenGroupRoom() new- conversationId:${newConvoId}: serverUrl:${urlToUse}` ); - sqlNode.saveV2OpenGroupRoom({ - ...r, - serverUrl: urlToUse, - conversationId: newConvoId, - }); + sqlNode.saveV2OpenGroupRoom( + { + ...r, + serverUrl: urlToUse, + conversationId: newConvoId, + }, + db + ); }); console.info( @@ -1058,10 +1061,13 @@ function updateToSessionSchemaVersion27(currentVersion: number, db: BetterSqlite `withIpButNotDuplicateConvo: renaming convo old:${r.id} with saveConversation() new- conversationId:${newConvoId}` ); convoIdsToMigrateFromIpToDns.set(r.id, newConvoId); - sqlNode.saveConversation({ - ...r, - id: newConvoId, - }); + sqlNode.saveConversation( + { + ...r, + id: newConvoId, + }, + db + ); }); console.info(