From 53dd2c1f1d8be3f3e1b120f5b897e59f821427c2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Guillot?= Date: Sat, 21 Mar 2020 15:01:16 -0700 Subject: [PATCH] Move schema version check after migration execution --- cli/cli.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/cli/cli.go b/cli/cli.go index 393d9b4e..c8cd8448 100644 --- a/cli/cli.go +++ b/cli/cli.go @@ -115,10 +115,6 @@ func Parse() { return } - if err := database.IsSchemaUpToDate(db); err != nil { - logger.Fatal(`You must run the SQL migrations, %v`, err) - } - store := storage.NewStorage(db) if flagResetFeedErrors { @@ -146,6 +142,10 @@ func Parse() { database.Migrate(db) } + if err := database.IsSchemaUpToDate(db); err != nil { + logger.Fatal(`You must run the SQL migrations, %v`, err) + } + // Create admin user and start the deamon. if config.Opts.CreateAdmin() { createAdmin(store)