We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 1ac1dd5 commit 7f48412Copy full SHA for 7f48412
api/pkg/di/container.go
@@ -333,8 +333,12 @@ func (container *Container) DB() (db *gorm.DB) {
333
container.logger.Fatal(stacktrace.Propagate(err, "cannot use GORM tracing plugin"))
334
}
335
336
- container.logger.Debug(fmt.Sprintf("Running migrations for %T", db))
+ if os.Getenv("DATABASE_MIGRATION_SKIP") != "" {
337
+ container.logger.Debug(fmt.Sprintf("skipping migrations for [%T]", db))
338
+ return container.db
339
+ }
340
341
+ container.logger.Debug(fmt.Sprintf("Running migrations for %T", db))
342
// This prevents a bug in the Gorm AutoMigrate where it tries to delete this no existent constraints
343
db.Exec(`
344
ALTER TABLE users ADD CONSTRAINT IF NOT EXISTS uni_users_api_key CHECK (api_key IS NOT NULL);
0 commit comments