Improve SQL template for `goose create' #34

This commit is contained in:
Vojtech Vitek 2019-03-05 16:29:17 -05:00
parent acc7a55e78
commit 89ee209ac1

View File

@ -59,10 +59,14 @@ func writeTemplateToFile(path string, t *template.Template, version string) (str
}
var sqlMigrationTemplate = template.Must(template.New("goose.sql-migration").Parse(`-- +goose Up
-- SQL in this section is executed when the migration is applied.
-- +goose StatementBegin
SELECT 'up SQL query';
-- +goose StatementEnd
-- +goose Down
-- SQL in this section is executed when the migration is rolled back.
-- +goose StatementBegin
SELECT 'down SQL query';
-- +goose StatementEnd
`))
var goSQLMigrationTemplate = template.Must(template.New("goose.go-migration").Parse(`package migration