From 2a75df303b76ee0fd47ef2eb31391f52e7685c72 Mon Sep 17 00:00:00 2001 From: Peter Eliasson Date: Sun, 7 Aug 2016 18:44:17 +0200 Subject: [PATCH] Reset db if currentVersion > target version. --- src/migrate.lua | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/migrate.lua b/src/migrate.lua index 6ffdb72..dd59ad2 100644 --- a/src/migrate.lua +++ b/src/migrate.lua @@ -160,6 +160,11 @@ function migrate:DoMigration() self:Debug(format("Attempting to migrate from dbVersion: %d to %d.", currentVersion, targetVersion)); + if currentVersion > targetVersion then + self:Debug(format("Could not migrate from dbVersion: %d!", currentVersion)); + resetDb(); + end + while currentVersion < targetVersion do local migrateFunction = migrateTable[currentVersion]; if migrateFunction then -- 1.7.9.5