diff options
author | Unknwon <u@gogs.io> | 2015-09-06 16:31:22 -0400 |
---|---|---|
committer | Unknwon <u@gogs.io> | 2015-09-06 16:31:22 -0400 |
commit | 85f34ba53843177999cb98bad046e9cce22bfc8f (patch) | |
tree | f1f7ca6d3b0fc4848216becd9bc2a25e019cb12e /models/models.go | |
parent | 00767a0522606cd504d81d35fa1d9e9c1e34610c (diff) | |
download | gitea-85f34ba53843177999cb98bad046e9cce22bfc8f.tar.gz gitea-85f34ba53843177999cb98bad046e9cce22bfc8f.zip |
new user profile settings UI
Signed-off-by: Unknwon <u@gogs.io>
Diffstat (limited to 'models/models.go')
-rw-r--r-- | models/models.go | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/models/models.go b/models/models.go index b446dcde16..be5f335115 100644 --- a/models/models.go +++ b/models/models.go @@ -72,6 +72,7 @@ var ( } EnableSQLite3 bool + EnableTidb bool ) func init() { @@ -143,6 +144,14 @@ func getEngine() (*xorm.Engine, error) { return nil, fmt.Errorf("Fail to create directories: %v", err) } cnnstr = "file:" + DbCfg.Path + "?cache=shared&mode=rwc" + case "tidb": + if !EnableTidb { + return nil, fmt.Errorf("Unknown database type: %s", DbCfg.Type) + } + if err := os.MkdirAll(path.Dir(DbCfg.Path), os.ModePerm); err != nil { + return nil, fmt.Errorf("Fail to create directories: %v", err) + } + cnnstr = "goleveldb://" + DbCfg.Path default: return nil, fmt.Errorf("Unknown database type: %s", DbCfg.Type) } |