mirror of
https://github.com/simplex-chat/simplex-chat.git
synced 2025-06-28 20:29:53 +00:00
desktop: fix postgres migration (#5739)
This commit is contained in:
parent
16cf91902c
commit
2317cee3eb
1 changed files with 5 additions and 1 deletions
|
@ -79,7 +79,11 @@ suspend fun initChatController(useKey: String? = null, confirmMigrations: Migrat
|
||||||
}
|
}
|
||||||
if (rerunMigration) {
|
if (rerunMigration) {
|
||||||
chatModel.dbMigrationInProgress.value = true
|
chatModel.dbMigrationInProgress.value = true
|
||||||
migrated = chatMigrateInit(dbAbsolutePrefixPath, dbKey, confirm.value)
|
migrated = if (databaseBackend == "postgres") {
|
||||||
|
chatMigrateInit("simplex_v1", "postgresql://simplex@/simplex_v1", confirm.value)
|
||||||
|
} else {
|
||||||
|
chatMigrateInit(dbAbsolutePrefixPath, dbKey, confirm.value)
|
||||||
|
}
|
||||||
res = runCatching {
|
res = runCatching {
|
||||||
json.decodeFromString<DBMigrationResult>(migrated[0] as String)
|
json.decodeFromString<DBMigrationResult>(migrated[0] as String)
|
||||||
}.getOrElse { DBMigrationResult.Unknown(migrated[0] as String) }
|
}.getOrElse { DBMigrationResult.Unknown(migrated[0] as String) }
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue