Compare commits
4 commits
add-licens
...
master
Author | SHA1 | Date | |
---|---|---|---|
a0def6e86a | |||
5d55cc1761 | |||
|
34a9ee7d2b | ||
|
ac09d418c1 |
4 changed files with 7 additions and 5 deletions
4
go.mod
4
go.mod
|
@ -1,9 +1,9 @@
|
|||
module github.com/joncalhoun/migrate
|
||||
module gitea.nulo.in/Nulo/go-migrate
|
||||
|
||||
go 1.14
|
||||
|
||||
require (
|
||||
github.com/jmoiron/sqlx v1.2.0
|
||||
github.com/mattn/go-sqlite3 v2.0.3+incompatible
|
||||
github.com/mattn/go-sqlite3 v1.14.16
|
||||
google.golang.org/appengine v1.6.6 // indirect
|
||||
)
|
||||
|
|
2
go.sum
2
go.sum
|
@ -6,6 +6,8 @@ github.com/jmoiron/sqlx v1.2.0/go.mod h1:1FEQNm3xlJgrMD+FBdI9+xvCksHtbpVBBw5dYhB
|
|||
github.com/lib/pq v1.0.0 h1:X5PMW56eZitiTeO7tKzZxFCSpbFZJtkMMooicw2us9A=
|
||||
github.com/lib/pq v1.0.0/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo=
|
||||
github.com/mattn/go-sqlite3 v1.9.0/go.mod h1:FPy6KqzDD04eiIsT53CuJW3U88zkxoIYsOqkbpncsNc=
|
||||
github.com/mattn/go-sqlite3 v1.14.16 h1:yOQRA0RpS5PFz/oikGwBEqvAWhWg5ufRz4ETLjwpU1Y=
|
||||
github.com/mattn/go-sqlite3 v1.14.16/go.mod h1:2eHXhiwb8IkHr+BDWZGa96P6+rkvnG63S2DGjv9HUNg=
|
||||
github.com/mattn/go-sqlite3 v2.0.3+incompatible h1:gXHsfypPkaMZrKbD5209QV9jbUTJKjyR5WD3HYQSd+U=
|
||||
github.com/mattn/go-sqlite3 v2.0.3+incompatible/go.mod h1:FPy6KqzDD04eiIsT53CuJW3U88zkxoIYsOqkbpncsNc=
|
||||
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
|
||||
|
|
4
sqlx.go
4
sqlx.go
|
@ -107,7 +107,7 @@ func (s *Sqlx) runMigration(db *sqlx.DB, m SqlxMigration) error {
|
|||
if err != nil {
|
||||
return errorf(err)
|
||||
}
|
||||
_, err = db.Exec("INSERT INTO migrations (id) VALUES ($1)", m.ID)
|
||||
_, err = tx.Exec("INSERT INTO migrations (id) VALUES ($1)", m.ID)
|
||||
if err != nil {
|
||||
tx.Rollback()
|
||||
return errorf(err)
|
||||
|
@ -131,7 +131,7 @@ func (s *Sqlx) runRollback(db *sqlx.DB, m SqlxMigration) error {
|
|||
if err != nil {
|
||||
return errorf(err)
|
||||
}
|
||||
_, err = db.Exec("DELETE FROM migrations WHERE id=$1", m.ID)
|
||||
_, err = tx.Exec("DELETE FROM migrations WHERE id=$1", m.ID)
|
||||
if err != nil {
|
||||
tx.Rollback()
|
||||
return errorf(err)
|
||||
|
|
|
@ -5,7 +5,7 @@ import (
|
|||
"fmt"
|
||||
"testing"
|
||||
|
||||
"github.com/joncalhoun/migrate"
|
||||
"gitea.nulo.in/Nulo/go-migrate"
|
||||
_ "github.com/mattn/go-sqlite3"
|
||||
)
|
||||
|
||||
|
|
Loading…
Reference in a new issue