diff --git a/storage-new/migrations.go b/storage-new/migrations.go index 260415c..90f8a11 100644 --- a/storage-new/migrations.go +++ b/storage-new/migrations.go @@ -6,6 +6,7 @@ import ( "git.mstar.dev/mstar/goutils/other" "git.mstar.dev/mstar/goutils/sliceutils" + "github.com/rs/zerolog" "gorm.io/gorm" "git.mstar.dev/mstar/linstrom/storage-new/models" @@ -13,6 +14,11 @@ import ( // Auto-migrate all tables and types used func Migrate(db *gorm.DB) error { + // Shut up gorm's queries during automigrate by setting log level to info during migration + // and then back to the previous value on exit + currentLogLevel := zerolog.GlobalLevel() + zerolog.SetGlobalLevel(zerolog.InfoLevel) + defer zerolog.SetGlobalLevel(currentLogLevel) if err := createAccountAuthMethodType(db); err != nil { return other.Error("storage", "Failed to create Auth Method type", err) }