Skip to content

Commit 1be881e

Browse files
committed
Change DEFAULT_VARCHAR to nvarchar
1 parent f4d8886 commit 1be881e

File tree

4 files changed

+5
-5
lines changed

4 files changed

+5
-5
lines changed

custom/conf/app.example.ini

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -378,9 +378,9 @@ 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 "varchar"
381+
; For Mssql only, either "varchar" or "nvarchar", default is "nvarchar"
382382
; NOTICE: if you changed the config, you have to convert the original columns type manually
383-
DEFAULT_VARCHAR = varchar
383+
DEFAULT_VARCHAR = nvarchar
384384
; For "sqlite3" and "tidb", use an absolute path when you start gitea as service
385385
PATH = data/gitea.db
386386
; For "sqlite3" only. Query timeout

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -245,7 +245,7 @@ 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`: **varchar**: For Mssql only, either "varchar" or "nvarchar"; If you changed the config, you have to convert the original columns type manually.
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.
249249
- `PATH`: **data/gitea.db**: For SQLite3 only, the database file path.
250250
- `LOG_SQL`: **true**: Log the executed SQL.
251251
- `DB_RETRIES`: **10**: How many ORM init / DB connect attempts allowed.

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

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

modules/setting/database.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ var (
4848
ConnMaxLifetime time.Duration
4949
IterateBufferSize int
5050
}{
51-
DefaultVarchar: "varchar",
51+
DefaultVarchar: "nvarchar",
5252
Timeout: 500,
5353
}
5454
)

0 commit comments

Comments
 (0)