Skip to content

Commit ec8da9e

Browse files
committed
Merge branch 'main' into fix-code-highlight
2 parents f0e2f97 + 3c6c150 commit ec8da9e

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

modules/setting/database.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@ import (
1313
"path/filepath"
1414
"strings"
1515
"time"
16+
17+
"code.gitea.io/gitea/modules/log"
1618
)
1719

1820
var (
@@ -83,6 +85,10 @@ func InitDBConfig() {
8385
Database.Schema = sec.Key("SCHEMA").String()
8486
Database.SSLMode = sec.Key("SSL_MODE").MustString("disable")
8587
Database.Charset = sec.Key("CHARSET").In(defaultCharset, []string{"utf8", "utf8mb4"})
88+
if Database.UseMySQL && defaultCharset != "utf8mb4" {
89+
log.Error("Deprecated database mysql charset utf8 support, please use utf8mb4 or convert utf8 to utf8mb4.")
90+
}
91+
8692
Database.Path = sec.Key("PATH").MustString(filepath.Join(AppDataPath, "gitea.db"))
8793
Database.Timeout = sec.Key("SQLITE_TIMEOUT").MustInt(500)
8894
Database.MaxIdleConns = sec.Key("MAX_IDLE_CONNS").MustInt(2)

0 commit comments

Comments
 (0)