mirror of
https://github.com/woodpecker-ci/woodpecker.git
synced 2024-11-27 04:11:03 +00:00
Cleanup some leftover
Don't have to import mattn/go-sqlite3 at pkg/database/migrate/sqlite.go Remove unused DriverFunction declaration at migrate.go
This commit is contained in:
parent
6a42686c29
commit
76ed21c40f
4 changed files with 3 additions and 6 deletions
|
@ -24,7 +24,7 @@ type Operation interface {
|
||||||
|
|
||||||
AddIndex(tableName string, columns []string, flag string) (sql.Result, error)
|
AddIndex(tableName string, columns []string, flag string) (sql.Result, error)
|
||||||
|
|
||||||
DropIndex(tableName string, columns[]string) (sql.Result, error)
|
DropIndex(tableName string, columns []string) (sql.Result, error)
|
||||||
}
|
}
|
||||||
|
|
||||||
type MigrationDriver struct {
|
type MigrationDriver struct {
|
||||||
|
@ -33,4 +33,3 @@ type MigrationDriver struct {
|
||||||
}
|
}
|
||||||
|
|
||||||
type DriverBuilder func(tx *sql.Tx) *MigrationDriver
|
type DriverBuilder func(tx *sql.Tx) *MigrationDriver
|
||||||
|
|
||||||
|
|
|
@ -48,6 +48,7 @@ INSERT INTO migration (revision) VALUES (?)
|
||||||
const deleteRevisionStmt = `
|
const deleteRevisionStmt = `
|
||||||
DELETE FROM migration where revision = ?
|
DELETE FROM migration where revision = ?
|
||||||
`
|
`
|
||||||
|
|
||||||
type Revision interface {
|
type Revision interface {
|
||||||
Up(mg *MigrationDriver) error
|
Up(mg *MigrationDriver) error
|
||||||
Down(mg *MigrationDriver) error
|
Down(mg *MigrationDriver) error
|
||||||
|
@ -59,8 +60,6 @@ type Migration struct {
|
||||||
revs []Revision
|
revs []Revision
|
||||||
}
|
}
|
||||||
|
|
||||||
type DriverFunction func(tx *sql.Tx) *MigrationDriver
|
|
||||||
|
|
||||||
var Driver DriverBuilder
|
var Driver DriverBuilder
|
||||||
|
|
||||||
func New(db *sql.DB) *Migration {
|
func New(db *sql.DB) *Migration {
|
||||||
|
|
|
@ -4,8 +4,6 @@ import (
|
||||||
"database/sql"
|
"database/sql"
|
||||||
"fmt"
|
"fmt"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
_ "github.com/mattn/go-sqlite3"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
type sqliteDriver struct {
|
type sqliteDriver struct {
|
||||||
|
|
|
@ -6,6 +6,7 @@ import (
|
||||||
"strings"
|
"strings"
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
|
_ "github.com/mattn/go-sqlite3"
|
||||||
"github.com/russross/meddler"
|
"github.com/russross/meddler"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue