Remove database.Set, all setup being done in database.Init now.

This commit is contained in:
Nurahmadie 2014-03-11 15:10:13 +07:00
parent 92dfcbfca9
commit 9a0b29d8b1

View file

@ -3,10 +3,8 @@ package database
import (
"database/sql"
"fmt"
"log"
"github.com/drone/drone/pkg/database/migrate"
"github.com/drone/drone/pkg/database/schema"
_ "github.com/go-sql-driver/mysql"
_ "github.com/mattn/go-sqlite3"
@ -57,19 +55,6 @@ func Init(name, datasource string) error {
return nil
}
// Set sets the default database.
func Set(database *sql.DB) {
// set the global database
db = database
// load the database schema. If this is
// a new database all the tables and
// indexes will be created.
if err := schema.Load(db); err != nil {
log.Fatal(err)
}
}
func Close() {
db.Close()
}