Merge pull request 'Mark deprecation of MSSQL' (#3041) from gusted/forgejo-deprecate-mssql into v7.0/forgejo

Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/3041
Reviewed-by: Otto <otto@codeberg.org>
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
This commit is contained in:
Earl Warren 2024-04-05 06:46:08 +00:00
commit fe8b34b8fc

View file

@ -12,6 +12,8 @@ import (
"path/filepath" "path/filepath"
"strings" "strings"
"time" "time"
"code.gitea.io/gitea/modules/log"
) )
var ( var (
@ -62,6 +64,11 @@ func loadDBSetting(rootCfg ConfigProvider) {
sec := rootCfg.Section("database") sec := rootCfg.Section("database")
Database.Type = DatabaseType(sec.Key("DB_TYPE").String()) Database.Type = DatabaseType(sec.Key("DB_TYPE").String())
if Database.Type.IsMSSQL() {
log.Error("Your Forgejo instance uses Microsoft SQL Server as its database which is scheduled for removal in v8.0. Please file an issue https://codeberg.org/forgejo/forgejo/issues/new to get help migrating to another database. Waiting 60 seconds before starting Forgejo")
time.Sleep(time.Second * 60)
}
Database.Host = sec.Key("HOST").String() Database.Host = sec.Key("HOST").String()
Database.Name = sec.Key("NAME").String() Database.Name = sec.Key("NAME").String()
Database.User = sec.Key("USER").String() Database.User = sec.Key("USER").String()