Compare commits

..

No commits in common. "master" and "add-license-1" have entirely different histories.

4 changed files with 5 additions and 7 deletions

4
go.mod
View file

@ -1,9 +1,9 @@
module gitea.nulo.in/Nulo/go-migrate module github.com/joncalhoun/migrate
go 1.14 go 1.14
require ( require (
github.com/jmoiron/sqlx v1.2.0 github.com/jmoiron/sqlx v1.2.0
github.com/mattn/go-sqlite3 v1.14.16 github.com/mattn/go-sqlite3 v2.0.3+incompatible
google.golang.org/appengine v1.6.6 // indirect google.golang.org/appengine v1.6.6 // indirect
) )

2
go.sum
View file

@ -6,8 +6,6 @@ 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 h1:X5PMW56eZitiTeO7tKzZxFCSpbFZJtkMMooicw2us9A=
github.com/lib/pq v1.0.0/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo= 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.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 h1:gXHsfypPkaMZrKbD5209QV9jbUTJKjyR5WD3HYQSd+U=
github.com/mattn/go-sqlite3 v2.0.3+incompatible/go.mod h1:FPy6KqzDD04eiIsT53CuJW3U88zkxoIYsOqkbpncsNc= 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= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=

View file

@ -107,7 +107,7 @@ func (s *Sqlx) runMigration(db *sqlx.DB, m SqlxMigration) error {
if err != nil { if err != nil {
return errorf(err) return errorf(err)
} }
_, err = tx.Exec("INSERT INTO migrations (id) VALUES ($1)", m.ID) _, err = db.Exec("INSERT INTO migrations (id) VALUES ($1)", m.ID)
if err != nil { if err != nil {
tx.Rollback() tx.Rollback()
return errorf(err) return errorf(err)
@ -131,7 +131,7 @@ func (s *Sqlx) runRollback(db *sqlx.DB, m SqlxMigration) error {
if err != nil { if err != nil {
return errorf(err) return errorf(err)
} }
_, err = tx.Exec("DELETE FROM migrations WHERE id=$1", m.ID) _, err = db.Exec("DELETE FROM migrations WHERE id=$1", m.ID)
if err != nil { if err != nil {
tx.Rollback() tx.Rollback()
return errorf(err) return errorf(err)

View file

@ -5,7 +5,7 @@ import (
"fmt" "fmt"
"testing" "testing"
"gitea.nulo.in/Nulo/go-migrate" "github.com/joncalhoun/migrate"
_ "github.com/mattn/go-sqlite3" _ "github.com/mattn/go-sqlite3"
) )