1
0
Fork 0
forked from forgejo/forgejo

Mirror fix on sqlite3 tag

This commit is contained in:
Unknown 2014-04-12 16:24:09 -04:00
parent d60f7b85e5
commit 23bba7633b
2 changed files with 11 additions and 3 deletions

View file

@ -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: