diff --git a/cmd/internal/initializer/initializer.go b/cmd/internal/initializer/initializer.go index 32a51b1..1320bc8 100644 --- a/cmd/internal/initializer/initializer.go +++ b/cmd/internal/initializer/initializer.go @@ -88,7 +88,12 @@ func (i *Initializer) Start(stop <-chan struct{}) { err = i.initialize() if err != nil { - i.log.Fatal(fmt.Errorf("error initializing database, shutting down:%w", err)) + i.log.Fatalw("error initializing database, shutting down", "error", err) + } + + err = i.db.Upgrade() + if err != nil { + i.log.Fatalw("ugrade database failed", "error", err) } i.log.Info("initializer done") @@ -138,11 +143,6 @@ func (i *Initializer) initialize() error { return fmt.Errorf("unable to restore database: %w", err) } - err = i.db.Upgrade() - if err != nil { - return err - } - return nil }