Remove database.Set, all setup being done in database.Init now.
This commit is contained in:
parent
92dfcbfca9
commit
9a0b29d8b1
1 changed files with 0 additions and 15 deletions
|
@ -3,10 +3,8 @@ package database
|
||||||
import (
|
import (
|
||||||
"database/sql"
|
"database/sql"
|
||||||
"fmt"
|
"fmt"
|
||||||
"log"
|
|
||||||
|
|
||||||
"github.com/drone/drone/pkg/database/migrate"
|
"github.com/drone/drone/pkg/database/migrate"
|
||||||
"github.com/drone/drone/pkg/database/schema"
|
|
||||||
|
|
||||||
_ "github.com/go-sql-driver/mysql"
|
_ "github.com/go-sql-driver/mysql"
|
||||||
_ "github.com/mattn/go-sqlite3"
|
_ "github.com/mattn/go-sqlite3"
|
||||||
|
@ -57,19 +55,6 @@ func Init(name, datasource string) error {
|
||||||
return nil
|
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() {
|
func Close() {
|
||||||
db.Close()
|
db.Close()
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue