wip
This commit is contained in:
+11
-2
@@ -82,7 +82,7 @@ func main() {
|
||||
continue
|
||||
}
|
||||
for _, cal := range cals {
|
||||
if err := st.EnsureCollection(user.Username, "cal-"+cal.Name); err != nil {
|
||||
if err := st.EnsureCollection(user.Username, "col/calendars/"+cal.Name); err != nil {
|
||||
logger.Warn("creating calendar collection", "user", user.Username, "cal", cal.Name, "error", err)
|
||||
}
|
||||
}
|
||||
@@ -92,12 +92,21 @@ func main() {
|
||||
continue
|
||||
}
|
||||
for _, book := range books {
|
||||
if err := st.EnsureCollection(user.Username, "card-"+book); err != nil {
|
||||
if err := st.EnsureCollection(user.Username, "col/addressbooks/"+book); err != nil {
|
||||
logger.Warn("creating address book collection", "user", user.Username, "book", book, "error", err)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Run migration from legacy flat layout (cal-*/card-* dirs and data/files/)
|
||||
// into new structured col/ subdirectory layout (<user>/col/<type>/<name>).
|
||||
logger.Info("starting migration from old layout to new col/ subdirectory structure")
|
||||
if err := store.MigrateDataDir(cfg.Storage.DataDir); err != nil {
|
||||
logger.Error("running storage migration", "error", err)
|
||||
os.Exit(1)
|
||||
}
|
||||
logger.Info("migration complete")
|
||||
|
||||
// ---- Middleware ----
|
||||
authMw := auth.NewMiddleware(cfg, dbase, logger)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user