From d37ac6d83fc70dee36fe79a618e7314aa18cb0b1 Mon Sep 17 00:00:00 2001 From: Luke Date: Sun, 23 Jun 2024 01:12:11 -0400 Subject: [PATCH] fix(database): call Migrate function after connection to make required tables --- cmd/spirit/main.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/cmd/spirit/main.go b/cmd/spirit/main.go index 2702b72..36a9ee6 100644 --- a/cmd/spirit/main.go +++ b/cmd/spirit/main.go @@ -55,6 +55,12 @@ func main() { Msg("Could not connect to database") } + if err := pg.Migrate(context.Background()); err != nil { + log.Fatal(). + Err(err). + Msg("Failed migrations; Could not create DOCUMENTS tables.") + } + m := server.NewServer(&config.Config, pg) m.MountMiddleware()