aboutsummaryrefslogtreecommitdiffstats
path: root/models
diff options
context:
space:
mode:
authorLunny Xiao <xiaolunwen@gmail.com>2020-07-21 20:28:27 +0800
committerGitHub <noreply@github.com>2020-07-21 20:28:27 +0800
commit45631083a452534b988b2ecc583e9258216562cd (patch)
treecb0fbdb0f971a3c41567f27b4c8c1dbd7547da72 /models
parented8e064f5ea53dd4012b26cfbe7dcde681e63dc2 (diff)
downloadgitea-45631083a452534b988b2ecc583e9258216562cd.tar.gz
gitea-45631083a452534b988b2ecc583e9258216562cd.zip
Support use nvarchar for all varchar columns when using mssql (#12269)
* Support use nvarchar for all varchar columns when using mssql * fix lint * Change DEFAULT_VARCHAR to nvarchar * Remove the config for default varchar since it's unnecessary
Diffstat (limited to 'models')
-rw-r--r--models/models.go2
1 files changed, 2 insertions, 0 deletions
diff --git a/models/models.go b/models/models.go
index 79a549b74b..d0703be300 100644
--- a/models/models.go
+++ b/models/models.go
@@ -145,6 +145,8 @@ func getEngine() (*xorm.Engine, error) {
}
if setting.Database.Type == "mysql" {
engine.Dialect().SetParams(map[string]string{"rowFormat": "DYNAMIC"})
+ } else if setting.Database.Type == "mssql" {
+ engine.Dialect().SetParams(map[string]string{"DEFAULT_VARCHAR": "nvarchar"})
}
engine.SetSchema(setting.Database.Schema)
return engine, nil