From 89ee209ac154897950a55edeb14a04b2ca8d0905 Mon Sep 17 00:00:00 2001 From: Vojtech Vitek Date: Tue, 5 Mar 2019 16:29:17 -0500 Subject: [PATCH] Improve SQL template for `goose create' #34 --- create.go | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/create.go b/create.go index 6761dec..940ce36 100644 --- a/create.go +++ b/create.go @@ -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