summaryrefslogtreecommitdiffstats
path: root/routers/install.go
diff options
context:
space:
mode:
authorbtrepp <beautrepp@gmail.com>2016-12-24 09:37:35 +0800
committerLunny Xiao <xiaolunwen@gmail.com>2016-12-24 09:37:35 +0800
commit25b5ffb6af390eac8d4a76c134379fd1ae88a423 (patch)
treee085f3f3af71ad81559ba8efeba05caceaa69fd2 /routers/install.go
parentf2ff0ee846e8ef42e2f7ba960e86bd8e397f007f (diff)
downloadgitea-25b5ffb6af390eac8d4a76c134379fd1ae88a423.tar.gz
gitea-25b5ffb6af390eac8d4a76c134379fd1ae88a423.zip
Enables mssql support (#383)
* Enables mssql support Port of dlobs work in gogs. Enables options in index.js Enables MSSQL as a database option in go. Sets ID to 0 on initial migration. Required for MSSQL insert statements. Signed-off-by: Beau Trepp <beautrepp@gmail.com> * Vendors in denisenkom/go-mssqldb Includes golang.org/x/crypto/md4 as this is required by go-msssqldb Signed-off-by: Beau Trepp <beautrepp@gmail.com>
Diffstat (limited to 'routers/install.go')
-rw-r--r--routers/install.go6
1 files changed, 4 insertions, 2 deletions
diff --git a/routers/install.go b/routers/install.go
index f18a8dbca3..9553f77b35 100644
--- a/routers/install.go
+++ b/routers/install.go
@@ -40,7 +40,7 @@ func InstallInit(ctx *context.Context) {
ctx.Data["Title"] = ctx.Tr("install.install")
ctx.Data["PageIsInstall"] = true
- dbOpts := []string{"MySQL", "PostgreSQL"}
+ dbOpts := []string{"MySQL", "PostgreSQL","MSSQL"}
if models.EnableSQLite3 {
dbOpts = append(dbOpts, "SQLite3")
}
@@ -64,6 +64,8 @@ func Install(ctx *context.Context) {
switch models.DbCfg.Type {
case "postgres":
ctx.Data["CurDbOption"] = "PostgreSQL"
+ case "mssql":
+ ctx.Data["CurDbOption"] = "MSSQL"
case "sqlite3":
if models.EnableSQLite3 {
ctx.Data["CurDbOption"] = "SQLite3"
@@ -139,7 +141,7 @@ func InstallPost(ctx *context.Context, form auth.InstallForm) {
// Pass basic check, now test configuration.
// Test database setting.
- dbTypes := map[string]string{"MySQL": "mysql", "PostgreSQL": "postgres", "SQLite3": "sqlite3", "TiDB": "tidb"}
+ dbTypes := map[string]string{"MySQL": "mysql", "PostgreSQL": "postgres", "MSSQL": "mssql", "SQLite3": "sqlite3", "TiDB": "tidb"}
models.DbCfg.Type = dbTypes[form.DbType]
models.DbCfg.Host = form.DbHost
models.DbCfg.User = form.DbUser