Skip to content

Commit 5fe2453

Browse files
committed
Remove the config for default varchar since it's unnecessary
1 parent 1be881e commit 5fe2453

File tree

5 files changed

+2
-10
lines changed

5 files changed

+2
-10
lines changed

custom/conf/app.example.ini

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -378,9 +378,6 @@ SSL_MODE = disable
378378
; For MySQL only, either "utf8" or "utf8mb4", default is "utf8mb4".
379379
; NOTICE: for "utf8mb4" you must use MySQL InnoDB > 5.6. Gitea is unable to check this.
380380
CHARSET = utf8mb4
381-
; For Mssql only, either "varchar" or "nvarchar", default is "nvarchar"
382-
; NOTICE: if you changed the config, you have to convert the original columns type manually
383-
DEFAULT_VARCHAR = nvarchar
384381
; For "sqlite3" and "tidb", use an absolute path when you start gitea as service
385382
PATH = data/gitea.db
386383
; For "sqlite3" only. Query timeout

docs/content/doc/advanced/config-cheat-sheet.en-us.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -245,7 +245,6 @@ Values containing `#` or `;` must be quoted using `` ` `` or `"""`.
245245
- `verify-ca`: Enable TLS with verification of the database server certificate against its root certificate.
246246
- `verify-full`: Enable TLS and verify the database server name matches the given certificate in either the `Common Name` or `Subject Alternative Name` fields.
247247
- `CHARSET`: **utf8mb4**: For MySQL only, either "utf8" or "utf8mb4". NOTICE: for "utf8mb4" you must use MySQL InnoDB > 5.6. Gitea is unable to check this.
248-
- `DEFAULT_VARCHAR`: **nvarchar**: For Mssql only, either "varchar" or "nvarchar"; If you changed the config, you have to convert the original columns type manually.
249248
- `PATH`: **data/gitea.db**: For SQLite3 only, the database file path.
250249
- `LOG_SQL`: **true**: Log the executed SQL.
251250
- `DB_RETRIES`: **10**: How many ORM init / DB connect attempts allowed.

docs/content/doc/advanced/config-cheat-sheet.zh-cn.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,6 @@ menu:
8282
- `PASSWD`: 数据库用户密码。
8383
- `SSL_MODE`: MySQL 或 PostgreSQL数据库是否启用SSL模式。
8484
- `CHARSET`: **utf8mb4**: 仅当数据库为 MySQL 时有效, 可以为 "utf8" 或 "utf8mb4"。注意:如果使用 "utf8mb4",你的 MySQL InnoDB 版本必须在 5.6 以上。
85-
- `DEFAULT_VARCHAR`: **nvarchar**: 仅当数据库为 Mssql 时有效, 可以为 "varchar" 或 "nvarchar"。如果改变了此项配置,你需要手动修改数据库中所有已创建的字段为指定的类型。
8685
- `PATH`: Tidb 或者 SQLite3 数据文件存放路径。
8786
- `LOG_SQL`: **true**: 显示生成的SQL,默认为真。
8887
- `MAX_IDLE_CONNS` **0**: 最大空闲数据库连接

models/models.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ func getEngine() (*xorm.Engine, error) {
146146
if setting.Database.Type == "mysql" {
147147
engine.Dialect().SetParams(map[string]string{"rowFormat": "DYNAMIC"})
148148
} else if setting.Database.Type == "mssql" {
149-
engine.Dialect().SetParams(map[string]string{"DEFAULT_VARCHAR": setting.Database.DefaultVarchar})
149+
engine.Dialect().SetParams(map[string]string{"DEFAULT_VARCHAR": "nvarchar"})
150150
}
151151
engine.SetSchema(setting.Database.Schema)
152152
return engine, nil

modules/setting/database.go

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@ var (
3535
Path string
3636
LogSQL bool
3737
Charset string
38-
DefaultVarchar string
3938
Timeout int // seconds
4039
UseSQLite3 bool
4140
UseMySQL bool
@@ -48,8 +47,7 @@ var (
4847
ConnMaxLifetime time.Duration
4948
IterateBufferSize int
5049
}{
51-
DefaultVarchar: "nvarchar",
52-
Timeout: 500,
50+
Timeout: 500,
5351
}
5452
)
5553

@@ -81,7 +79,6 @@ func InitDBConfig() {
8179
Database.Schema = sec.Key("SCHEMA").String()
8280
Database.SSLMode = sec.Key("SSL_MODE").MustString("disable")
8381
Database.Charset = sec.Key("CHARSET").In("utf8", []string{"utf8", "utf8mb4"})
84-
Database.DefaultVarchar = sec.Key("DEFAULT_VARCHAR").In("varchar", []string{"varchar", "nvarchar"})
8582
Database.Path = sec.Key("PATH").MustString(filepath.Join(AppDataPath, "gitea.db"))
8683
Database.Timeout = sec.Key("SQLITE_TIMEOUT").MustInt(500)
8784
Database.MaxIdleConns = sec.Key("MAX_IDLE_CONNS").MustInt(2)

0 commit comments

Comments
 (0)