summaryrefslogtreecommitdiffstats
path: root/models/models.go
diff options
context:
space:
mode:
authorUnknown <joe2010xtmf@163.com>2014-04-12 16:24:09 -0400
committerUnknown <joe2010xtmf@163.com>2014-04-12 16:24:09 -0400
commit23bba7633bbd8ae8f9f41404352c327f9e8c9fdc (patch)
treea237e08392c8ce860cf8c054d20fb46e125f141b /models/models.go
parentd60f7b85e53d0d2fbef9d8e2a8b539f9c0d97233 (diff)
downloadgitea-23bba7633bbd8ae8f9f41404352c327f9e8c9fdc.tar.gz
gitea-23bba7633bbd8ae8f9f41404352c327f9e8c9fdc.zip
Mirror fix on sqlite3 tag
Diffstat (limited to 'models/models.go')
-rw-r--r--models/models.go6
1 files changed, 5 insertions, 1 deletions
diff --git a/models/models.go b/models/models.go
index 010228aed3..b8374a3d67 100644
--- a/models/models.go
+++ b/models/models.go
@@ -26,7 +26,8 @@ var (
Type, Host, Name, User, Pwd, Path, SslMode string
}
- UseSQLite3 bool
+ EnableSQLite3 bool
+ UseSQLite3 bool
)
func init() {
@@ -56,6 +57,9 @@ func NewTestEngine(x *xorm.Engine) (err error) {
x, err = xorm.NewEngine("postgres", fmt.Sprintf("user=%s password=%s dbname=%s sslmode=%s",
DbCfg.User, DbCfg.Pwd, DbCfg.Name, DbCfg.SslMode))
case "sqlite3":
+ if !EnableSQLite3 {
+ return fmt.Errorf("Unknown database type: %s", DbCfg.Type)
+ }
os.MkdirAll(path.Dir(DbCfg.Path), os.ModePerm)
x, err = xorm.NewEngine("sqlite3", DbCfg.Path)
default: