forked from forgejo/forgejo
Support disabling database auto migration (#22053)
Gitea will migrate the database model version automatically, but it should be able to be disabled and keep Gitea shutdown if the version is not matched.
This commit is contained in:
parent
e2fa84fddc
commit
0a85537c79
5 changed files with 27 additions and 1 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue