From 2fd7da2265b47eb05b42c015dae2ec99a4ea9647 Mon Sep 17 00:00:00 2001 From: Matthew Chen Date: Thu, 21 Jan 2021 22:15:25 -0300 Subject: [PATCH] Fix GRDB schema migration. --- .../src/Storage/Database/GRDBSchemaMigrator.swift | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/SignalServiceKit/src/Storage/Database/GRDBSchemaMigrator.swift b/SignalServiceKit/src/Storage/Database/GRDBSchemaMigrator.swift index 5e53dd8755..68788427cb 100644 --- a/SignalServiceKit/src/Storage/Database/GRDBSchemaMigrator.swift +++ b/SignalServiceKit/src/Storage/Database/GRDBSchemaMigrator.swift @@ -129,7 +129,7 @@ public class GRDBSchemaMigrator: NSObject { } public static let grdbSchemaVersionDefault: UInt = 0 - public static let grdbSchemaVersionLatest: UInt = 17 + public static let grdbSchemaVersionLatest: UInt = 18 // An optimization for new users, we have the first migration import the latest schema // and mark any other migrations as "already run". @@ -919,6 +919,8 @@ public class GRDBSchemaMigrator: NSObject { try db.alter(table: "model_TSInteraction") { table in table.add(column: "wasIdentityVerified", .boolean) } + + try db.execute(sql: "UPDATE model_TSInteraction SET wasIdentityVerified = 0") } catch { owsFail("Error: \(error)") }