Browse Source

models: remove TiDB embedded driver support

Users should all start tidb-server process and connect to it as if
it is a MySQL server with MySQL drivers.
Unknwon 8 years ago
parent
commit
6622b7b49a
7 changed files with 9 additions and 45 deletions
  1. 7 6
      conf/app.ini
  2. 1 1
      gogs.go
  3. 0 9
      models/models.go
  4. 0 18
      models/models_tidb.go
  5. 0 0
      modules/bindata/bindata.go
  6. 0 10
      routers/install.go
  7. 1 1
      templates/.VERSION

+ 7 - 6
conf/app.ini

@@ -59,11 +59,11 @@ EXPLORE_PAGING_NUM = 20
 ISSUE_PAGING_NUM = 10
 ; Number of maximum commits showed in one activity feed
 FEED_MAX_COMMIT_NUM = 5
-; Value of `theme-color` meta tag, used by Android >= 5.0
+; Value of "theme-color" meta tag, used by Android >= 5.0
 ; An invalid color like "none" or "disable" will have the default style
 ; More info: https://developers.google.com/web/updates/2014/11/Support-for-theme-color-in-Chrome-39-for-Android
 THEME_COLOR_META_TAG = `#ff5343`
-; Max size of files to be displayed (defaults is 8MiB)
+; Max size in bytes of files to be displayed (default is 8MB)
 MAX_DISPLAY_FILE_SIZE = 8388608
 
 [ui.admin]
@@ -106,12 +106,12 @@ LOCAL_ROOT_URL = %(PROTOCOL)s://%(HTTP_ADDR)s:%(HTTP_PORT)s/
 DISABLE_SSH = false
 ; Whether use builtin SSH server or not.
 START_SSH_SERVER = false
-; Domain name to be exposed in clone URL
+; Domain name to be exposed in SSH clone URL
 SSH_DOMAIN = %(DOMAIN)s
+; Port number to be exposed in SSH clone URL
+SSH_PORT = 22
 ; Network interface builtin SSH server listens on
 SSH_LISTEN_HOST = 0.0.0.0
-; Port number to be exposed in clone URL
-SSH_PORT = 22
 ; Port number builtin SSH server listens on
 SSH_LISTEN_PORT = %(SSH_PORT)s
 ; Root path of SSH directory, default is '~/.ssh', but you have to use '/home/git/.ssh'.
@@ -157,7 +157,7 @@ RSA     = 2048
 DSA     = 1024
 
 [database]
-; Either "mysql", "postgres" or "sqlite3", it's your choice
+; Either "mysql", "postgres" or "sqlite3", you can connect to TiDB with MySQL protocol
 DB_TYPE = mysql
 HOST = 127.0.0.1:3306
 NAME = gogs
@@ -268,6 +268,7 @@ GC_INTERVAL_TIME = 86400
 SESSION_LIFE_TIME = 86400
 
 [picture]
+; Path to store user uploaded avatars
 AVATAR_UPLOAD_PATH = data/avatars
 ; Chinese users can choose "duoshuo"
 ; or a custom avatar source, like: http://cn.gravatar.com/avatar/

+ 1 - 1
gogs.go

@@ -16,7 +16,7 @@ import (
 	"github.com/gogits/gogs/modules/setting"
 )
 
-const APP_VER = "0.9.135.0208"
+const APP_VER = "0.9.135.0209"
 
 func init() {
 	setting.AppVer = APP_VER

+ 0 - 9
models/models.go

@@ -55,7 +55,6 @@ var (
 	}
 
 	EnableSQLite3 bool
-	EnableTiDB    bool
 )
 
 func init() {
@@ -146,14 +145,6 @@ func getEngine() (*xorm.Engine, error) {
 			return nil, fmt.Errorf("Fail to create directories: %v", err)
 		}
 		connStr = "file:" + DbCfg.Path + "?cache=shared&mode=rwc"
-	case "tidb":
-		if !EnableTiDB {
-			return nil, errors.New("This binary version does not build support for TiDB.")
-		}
-		if err := os.MkdirAll(path.Dir(DbCfg.Path), os.ModePerm); err != nil {
-			return nil, fmt.Errorf("Fail to create directories: %v", err)
-		}
-		connStr = "goleveldb://" + DbCfg.Path
 	default:
 		return nil, fmt.Errorf("Unknown database type: %s", DbCfg.Type)
 	}

+ 0 - 18
models/models_tidb.go

@@ -1,18 +0,0 @@
-// +build tidb go1.4.2
-
-// Copyright 2015 The Gogs Authors. All rights reserved.
-// Use of this source code is governed by a MIT-style
-// license that can be found in the LICENSE file.
-
-package models
-
-import (
-	_ "github.com/go-xorm/tidb"
-	"github.com/ngaut/log"
-	_ "github.com/pingcap/tidb"
-)
-
-func init() {
-	EnableTiDB = true
-	log.SetLevelByString("error")
-}

File diff suppressed because it is too large
+ 0 - 0
modules/bindata/bindata.go


+ 0 - 10
routers/install.go

@@ -81,9 +81,6 @@ func GlobalInit() {
 	if models.EnableSQLite3 {
 		log.Info("SQLite3 Supported")
 	}
-	if models.EnableTiDB {
-		log.Info("TiDB Supported")
-	}
 	if setting.SupportMiniWinService {
 		log.Info("Builtin Windows Service Supported")
 	}
@@ -108,9 +105,6 @@ func InstallInit(ctx *context.Context) {
 	if models.EnableSQLite3 {
 		dbOpts = append(dbOpts, "SQLite3")
 	}
-	if models.EnableTiDB {
-		dbOpts = append(dbOpts, "TiDB")
-	}
 	ctx.Data["DbOptions"] = dbOpts
 }
 
@@ -131,10 +125,6 @@ func Install(ctx *context.Context) {
 		if models.EnableSQLite3 {
 			ctx.Data["CurDbOption"] = "SQLite3"
 		}
-	case "tidb":
-		if models.EnableTiDB {
-			ctx.Data["CurDbOption"] = "TiDB"
-		}
 	}
 
 	// Application general settings

+ 1 - 1
templates/.VERSION

@@ -1 +1 @@
-0.9.135.0208
+0.9.135.0209

Some files were not shown because too many files changed in this diff