dev/post-reports #20

Merged
SoXX merged 7 commits from dev/post-reports into main 2024-11-06 11:24:01 +00:00
3 changed files with 7 additions and 3 deletions
Showing only changes of commit 18a68b452f - Show all commits

View File

@ -70,9 +70,11 @@ func Connect(ctx context.Context, config models.DatabaseConfig) error {
return utils.HandleError(ctx, span, localLogger, err)
}
err = migrateDatabase(ctx, sqlDB, config)
if err != nil {
return utils.HandleError(ctx, span, localLogger, err)
if config.Migrate {
err = migrateDatabase(ctx, sqlDB, config)
if err != nil {
return utils.HandleError(ctx, span, localLogger, err)
}
}
client = sqlDB

View File

@ -9,4 +9,5 @@ type DatabaseConfig struct {
SSL bool `env:"DB_SSL,required" envDefault:"true"`
Timezone string `env:"DB_TIMEZONE,required" envDefault:"Europe/Berlin"`
Debug bool `env:"DB_DEBUG" envDefault:"false"`
Migrate bool
}

View File

@ -121,6 +121,7 @@ func DatabaseModesFromConnectionString(ctx context.Context, pgContainer *postgre
SSL: false,
Timezone: "Europe/Berlin",
Debug: true,
Migrate: true,
}
return databaseConfig, nil