Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ migrations := &migrate.FileMigrationSource{

// OR: Use migrations from a packr box
migrations := &migrate.PackrMigrationSource{
Box: packr.NewBox("./migrations"),
Box: packr.New("migrations", "./migrations"),
}

// OR: Use migrations from bindata:
Expand Down Expand Up @@ -250,11 +250,17 @@ If you like your Go applications self-contained (that is: a single binary): use

Just write your migration files as usual, as a set of SQL files in a folder.

Import the packr package into your application:

```go
import "github.com/gobuffalo/packr/v2"
```

Use the `PackrMigrationSource` in your application to find the migrations:

```go
migrations := &migrate.PackrMigrationSource{
Box: packr.NewBox("./migrations"),
Box: packr.New("migrations", "./migrations"),
}
```

Expand Down
4 changes: 2 additions & 2 deletions migrate_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"database/sql"
"net/http"

"github.com/gobuffalo/packr"
"github.com/gobuffalo/packr/v2"
_ "github.com/mattn/go-sqlite3"
. "gopkg.in/check.v1"
"gopkg.in/gorp.v1"
Expand Down Expand Up @@ -162,7 +162,7 @@ func (s *SqliteMigrateSuite) TestAssetMigrate(c *C) {

func (s *SqliteMigrateSuite) TestPackrMigrate(c *C) {
migrations := &PackrMigrationSource{
Box: packr.NewBox("test-migrations"),
Box: packr.New("migrations", "test-migrations"),
}

// Executes two migrations
Expand Down