storage: start db migration (badger(hold))

migrating to badger, with the badgerhold frontend. So far, done:
* Announcements (small, for a quick test)
* Discord/Telegram/Matrix/Email

most interaction with badgerhold is done through the standard
Get<x>/Get<x>Key/Set<x>Key/Delete<x>Key. UserExists functions have been
added for email and matrix, and those and the original ones now use a
query against the database rather than sifting through every record.
I've tagged these searched fields as "index" for badgerhold, although this
definitely isn't used yet, and i'm not entirely sure if it'll be useful.

migrateToBadger is now in migrations.go, and a temporary config key
"migrated_to_badger" has been added, although it isn't being used yet,
migration is just running every time during development.
This commit is contained in:
Harvey Tindall
2023-06-24 17:01:52 +01:00
parent fc7ae0ec4e
commit 833be688ac
12 changed files with 458 additions and 176 deletions

View File

@@ -37,6 +37,8 @@ func (app *appContext) loadConfig() error {
return err
}
app.MustSetValue("", "migrated_to_db", "false")
app.MustSetValue("jellyfin", "public_server", app.config.Section("jellyfin").Key("server").String())
app.MustSetValue("ui", "redirect_url", app.config.Section("jellyfin").Key("public_server").String())