Skip to content

Commit

Permalink
Fix migration process
Browse files Browse the repository at this point in the history
  • Loading branch information
Slivo-fr committed May 8, 2021
1 parent 029959c commit 956fbc1
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
1 change: 0 additions & 1 deletion src/defaults.lua
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ function TranqRotate:LoadDefaults()
incapacitatedDelay = 2,
enableTimedBackupAlert = false,
timedBackupAlertDelay = 3,
currentMigration = #TranqRotate.migrations,
},
}
end
7 changes: 5 additions & 2 deletions src/migration.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit 956fbc1

Please sign in to comment.