Skip to content

Commit

Permalink
Merge branch 'master' of github.com:gogits/gogs into dev
Browse files Browse the repository at this point in the history
  • Loading branch information
unknwon committed Apr 12, 2014
2 parents 802a110 + 25ecf56 commit 47f3dd4
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 4 deletions.
7 changes: 3 additions & 4 deletions models/models.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ import (
_ "github.com/go-sql-driver/mysql"
_ "github.com/lib/pq"
"github.com/lunny/xorm"
// _ "github.com/mattn/go-sqlite3"

"github.com/gogits/gogs/modules/base"
)
Expand Down Expand Up @@ -56,9 +55,9 @@ func NewTestEngine(x *xorm.Engine) (err error) {
case "postgres":
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":
// os.MkdirAll(path.Dir(DbCfg.Path), os.ModePerm)
// x, err = xorm.NewEngine("sqlite3", DbCfg.Path)
case "sqlite3":
os.MkdirAll(path.Dir(DbCfg.Path), os.ModePerm)
x, err = xorm.NewEngine("sqlite3", DbCfg.Path)
default:
return fmt.Errorf("Unknown database type: %s", DbCfg.Type)
}
Expand Down
11 changes: 11 additions & 0 deletions models/models_sqlite.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
// +build sqlite

// Copyright 2014 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/mattn/go-sqlite3"
)

0 comments on commit 47f3dd4

Please sign in to comment.