Merge branch 'dev/post-reports' of git.anthrove.art:Anthrove/otter-space-sdk into dev/post-reports
This commit is contained in:
commit
18a68b452f
@ -70,10 +70,12 @@ func Connect(ctx context.Context, config models.DatabaseConfig) error {
|
||||
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
|
||||
utils.HandleEvent(span, localLogger, "Database connected successfully")
|
||||
|
@ -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
|
||||
}
|
||||
|
@ -121,6 +121,7 @@ func DatabaseModesFromConnectionString(ctx context.Context, pgContainer *postgre
|
||||
SSL: false,
|
||||
Timezone: "Europe/Berlin",
|
||||
Debug: true,
|
||||
Migrate: true,
|
||||
}
|
||||
|
||||
return databaseConfig, nil
|
||||
|
Loading…
Reference in New Issue
Block a user