Skip to content

πŸ“š The open-source, offline-first Notion, Obsidian & Confluence alternative. Advanced Markdown, multi-tenant teams, OIDC/SSO, and local S3 backups. Deploy in one command.

Fix database migrations order (before repo init)

Smaug67398cbaa77cb03e
diff --git a/backend/app/app.go b/backend/app/app.go
index d075f1b1..1900492e 100644
--- a/backend/app/app.go
+++ b/backend/app/app.go
@@ -50,6 +50,9 @@ func InitApp(config Config) *App {
app.Snowflake = utils.NewSnowflake(1609459200000)
app.Config = config
+ // Run database migrations / schema creation
+ Migrate(&config)
+
// Initialize repository manager
repoManager, err := repositories.NewRepositoryManager(app.DB)
if err != nil {
@@ -64,6 +67,5 @@ func InitApp(config Config) *App {
}
app.Services = serviceManager
- Migrate(&config)
return &app
}