diff options
Diffstat (limited to 'modules')
-rw-r--r-- | modules/doctor/dbversion.go | 1 | ||||
-rw-r--r-- | modules/setting/database.go | 2 |
2 files changed, 3 insertions, 0 deletions
diff --git a/modules/doctor/dbversion.go b/modules/doctor/dbversion.go index 3ddca92fb3..2b20cb2340 100644 --- a/modules/doctor/dbversion.go +++ b/modules/doctor/dbversion.go @@ -12,6 +12,7 @@ import ( ) func checkDBVersion(ctx context.Context, logger log.Logger, autofix bool) error { + logger.Info("Expected database version: %d", migrations.ExpectedVersion()) if err := db.InitEngineWithMigration(ctx, migrations.EnsureUpToDate); err != nil { if !autofix { logger.Critical("Error: %v during ensure up to date", err) diff --git a/modules/setting/database.go b/modules/setting/database.go index be06c47478..5480f9dffd 100644 --- a/modules/setting/database.go +++ b/modules/setting/database.go @@ -49,6 +49,7 @@ var ( MaxOpenConns int ConnMaxLifetime time.Duration IterateBufferSize int + AutoMigration bool }{ Timeout: 500, IterateBufferSize: 50, @@ -105,6 +106,7 @@ func InitDBConfig() { Database.LogSQL = sec.Key("LOG_SQL").MustBool(true) Database.DBConnectRetries = sec.Key("DB_RETRIES").MustInt(10) Database.DBConnectBackoff = sec.Key("DB_RETRY_BACKOFF").MustDuration(3 * time.Second) + Database.AutoMigration = sec.Key("AUTO_MIGRATION").MustBool(true) } // DBConnStr returns database connection string |