File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -159,7 +159,7 @@ migrations := &migrate.FileMigrationSource{
159159
160160// OR: Use migrations from a packr box
161161migrations := &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
251251Just 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+
253259Use the `PackrMigrationSource` in your application to find the migrations :
254260
255261` ` ` go
256262migrations := &migrate.PackrMigrationSource{
257- Box: packr.NewBox( "./migrations"),
263+ Box: packr.New("migrations", "./migrations"),
258264}
259265` ` `
260266
Original file line number Diff line number Diff line change 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
163163func (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
You can’t perform that action at this time.
0 commit comments