From 5f5ad81ac0d0a0f3e56e39e646e8423c617df523 Mon Sep 17 00:00:00 2001 From: Nathan Fallet Date: Tue, 25 Jan 2022 16:57:56 +0100 Subject: [PATCH] Reset userVersion if set to nil --- Sources/SQLite/Core/Connection.swift | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/Sources/SQLite/Core/Connection.swift b/Sources/SQLite/Core/Connection.swift index 043cfafc..72e8d857 100644 --- a/Sources/SQLite/Core/Connection.swift +++ b/Sources/SQLite/Core/Connection.swift @@ -159,9 +159,7 @@ public final class Connection { (try? scalar("PRAGMA user_version") as? Int64).map(Int32.init) } set { - if let userVersion = newValue { - _ = try? run("PRAGMA user_version = \(userVersion)") - } + _ = try? run("PRAGMA user_version = \(newValue ?? 0)") } }