Skip to content

Commit 47f3dd4

Browse files
committed
Merge branch 'master' of github.com:gogits/gogs into dev
2 parents 802a110 + 25ecf56 commit 47f3dd4

File tree

2 files changed

+14
-4
lines changed

2 files changed

+14
-4
lines changed

models/models.go

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ import (
1212
_ "github.com/go-sql-driver/mysql"
1313
_ "github.com/lib/pq"
1414
"github.com/lunny/xorm"
15-
// _ "github.com/mattn/go-sqlite3"
1615

1716
"github.com/gogits/gogs/modules/base"
1817
)
@@ -56,9 +55,9 @@ func NewTestEngine(x *xorm.Engine) (err error) {
5655
case "postgres":
5756
x, err = xorm.NewEngine("postgres", fmt.Sprintf("user=%s password=%s dbname=%s sslmode=%s",
5857
DbCfg.User, DbCfg.Pwd, DbCfg.Name, DbCfg.SslMode))
59-
// case "sqlite3":
60-
// os.MkdirAll(path.Dir(DbCfg.Path), os.ModePerm)
61-
// x, err = xorm.NewEngine("sqlite3", DbCfg.Path)
58+
case "sqlite3":
59+
os.MkdirAll(path.Dir(DbCfg.Path), os.ModePerm)
60+
x, err = xorm.NewEngine("sqlite3", DbCfg.Path)
6261
default:
6362
return fmt.Errorf("Unknown database type: %s", DbCfg.Type)
6463
}

models/models_sqlite.go

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
// +build sqlite
2+
3+
// Copyright 2014 The Gogs Authors. All rights reserved.
4+
// Use of this source code is governed by a MIT-style
5+
// license that can be found in the LICENSE file.
6+
7+
package models
8+
9+
import (
10+
_ "github.com/mattn/go-sqlite3"
11+
)

0 commit comments

Comments
 (0)