1
0
mirror of https://github.com/hrfee/jfa-go.git synced 2024-12-22 09:00:10 +00:00

db: mark migration as completed when it's done

migrated_to_db config key is used. Might also add an extra check to see
if anything is in the DB.
This commit is contained in:
Harvey Tindall 2023-06-25 19:47:31 +01:00
parent bb75bfd15d
commit e9f9d9dc98
Signed by: hrfee
GPG Key ID: BBC65952848FB1A2

View File

@ -280,6 +280,11 @@ func migrateToBadger(app *appContext) {
if _, ok := app.storage.GetCustomContentKey("UserPage"); !ok {
app.storage.SetCustomContentKey("UserPage", app.storage.deprecatedUserPageContent.Page)
}
tempConfig, _ := ini.Load(app.configPath)
tempConfig.Section("").Key("migrated_to_db").SetValue("true")
tempConfig.SaveTo(app.configPath)
app.info.Println("All data migrated to database. JSON files in the config folder can be deleted if you are sure all data is correct in the app. Create an issue if you have problems.")
}
// Migrate between hyphenated & non-hyphenated user IDs. Doesn't seem to happen anymore, so disabled.