Skip to content
Snippets Groups Projects
Commit bd3a8c33 authored by Dariusz Rybicki's avatar Dariusz Rybicki
Browse files

Merge branch 'fix/legacy-db-migration-fix' into 'main'

Fix legacy database migration

See merge request elixxir/client-ios-db!23
parents 0fde5504 8a7544e0
No related branches found
No related tags found
1 merge request!23Fix legacy database migration
......@@ -138,6 +138,15 @@ public struct LegacyDatabase {
}
migrator.registerMigration("v2") { db in
let contactsTableContainsIsRecentColumn = try Row
.fetchAll(db, sql: "pragma table_info(contacts)")
.map { $0["name"] }
.contains("isRecent")
guard contactsTableContainsIsRecentColumn == false else {
return
}
try db.alter(table: Contact.databaseTableName) { table in
table.add(column: Contact.Column.isRecent.rawValue, .boolean)
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment