diff --git a/create.go b/create.go index 1a8bb74c0..eeca796fb 100644 --- a/create.go +++ b/create.go @@ -99,20 +99,21 @@ SELECT 'down SQL query'; var goSQLMigrationTemplate = template.Must(template.New("goose.go-migration").Parse(`package migrations import ( + "context" "database/sql" "github.com/pressly/goose/v3" ) func init() { - goose.AddMigration(up{{.CamelName}}, down{{.CamelName}}) + goose.AddMigrationContext(up{{.CamelName}}, down{{.CamelName}}) } -func up{{.CamelName}}(tx *sql.Tx) error { +func up{{.CamelName}}(ctx context.Context, tx *sql.Tx) error { // This code is executed when the migration is applied. return nil } -func down{{.CamelName}}(tx *sql.Tx) error { +func down{{.CamelName}}(ctx context.Context, tx *sql.Tx) error { // This code is executed when the migration is rolled back. return nil }