Skip to content

Commit ce2300b

Browse files
authored
Merge pull request #154 from codestation/feature-packr2
Use packr v2 on examples and tests
2 parents 9355dd0 + d787e50 commit ce2300b

2 files changed

Lines changed: 10 additions & 4 deletions

File tree

README.md

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@ migrations := &migrate.FileMigrationSource{
159159
160160
// OR: Use migrations from a packr box
161161
migrations := &migrate.PackrMigrationSource{
162-
Box: packr.NewBox("./migrations"),
162+
Box: packr.New("migrations", "./migrations"),
163163
}
164164
165165
// OR: Use migrations from bindata:
@@ -250,11 +250,17 @@ If you like your Go applications self-contained (that is: a single binary): use
250250

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

253+
Import the packr package into your application:
254+
255+
```go
256+
import "github.com/gobuffalo/packr/v2"
257+
```
258+
253259
Use the `PackrMigrationSource` in your application to find the migrations:
254260

255261
```go
256262
migrations := &migrate.PackrMigrationSource{
257-
Box: packr.NewBox("./migrations"),
263+
Box: packr.New("migrations", "./migrations"),
258264
}
259265
```
260266

migrate_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import (
44
"database/sql"
55
"net/http"
66

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

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

168168
// Executes two migrations

0 commit comments

Comments
 (0)