From 51ff3a360875d23aeef42e2662b19fec707e1348 Mon Sep 17 00:00:00 2001 From: Matt Siwiec Date: Fri, 3 Nov 2023 18:00:09 +0000 Subject: [PATCH] register event hooks Signed-off-by: Matt Siwiec --- cmd/serve.go | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/cmd/serve.go b/cmd/serve.go index d1cf367..2574613 100644 --- a/cmd/serve.go +++ b/cmd/serve.go @@ -25,6 +25,7 @@ import ( "go.infratographer.com/location-api/internal/config" ent "go.infratographer.com/location-api/internal/ent/generated" + "go.infratographer.com/location-api/internal/ent/generated/eventhooks" "go.infratographer.com/location-api/internal/graphapi" ) @@ -113,6 +114,14 @@ func serve(ctx context.Context) error { client := ent.NewClient(cOpts...) defer client.Close() + // Run the automatic migration tool to create all schema resources. + if err := client.Schema.Create(ctx); err != nil { + logger.Errorf("failed creating schema resources", zap.Error(err)) + return err + } + + eventhooks.EventHooks(client) + var middleware []echo.MiddlewareFunc // jwt auth middleware