From 956fbc121c8ff496c7981cae3b211624d80c25cd Mon Sep 17 00:00:00 2001 From: Slivo Date: Sat, 8 May 2021 15:52:14 +0200 Subject: [PATCH] Fix migration process --- src/defaults.lua | 1 - src/migration.lua | 7 +++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/defaults.lua b/src/defaults.lua index e7c3f01..e7b2b20 100644 --- a/src/defaults.lua +++ b/src/defaults.lua @@ -23,7 +23,6 @@ function TranqRotate:LoadDefaults() incapacitatedDelay = 2, enableTimedBackupAlert = false, timedBackupAlertDelay = 3, - currentMigration = #TranqRotate.migrations, }, } end diff --git a/src/migration.lua b/src/migration.lua index 5cf7675..0e595b3 100644 --- a/src/migration.lua +++ b/src/migration.lua @@ -4,8 +4,11 @@ function TranqRotate:migrateProfile() TranqRotate.db.profile.currentMigration = 0 end - for i = TranqRotate.db.profile.currentMigration + 1, #TranqRotate.migrations, 1 do - TranqRotate.migrations[i]() + if (TranqRotate.db.profile.currentMigration < #TranqRotate.migrations) then + for i = TranqRotate.db.profile.currentMigration + 1, #TranqRotate.migrations, 1 do + TranqRotate.migrations[i]() + TranqRotate.db.profile.currentMigration = i + end end end