mirror of https://github.com/pressly/goose.git
Merged in vinibaggio/goose/vinibaggio-raise-error-on-incomplete-buffer (pull request #45)
Add a warning on non-empty buffer.pull/2/head
commit
9d1a22dde8
|
@ -115,6 +115,10 @@ func splitSQLStatements(r io.Reader, direction bool) (stmts []string) {
|
|||
log.Println("WARNING: saw '-- +goose StatementBegin' with no matching '-- +goose StatementEnd'")
|
||||
}
|
||||
|
||||
if bufferRemaining := strings.TrimSpace(buf.String()); len(bufferRemaining) > 0 {
|
||||
log.Printf("WARNING: Unexpected unfinished SQL query: %s. Missing a semicolon?\n", bufferRemaining)
|
||||
}
|
||||
|
||||
if upSections == 0 && downSections == 0 {
|
||||
log.Fatalf(`ERROR: no Up/Down annotations found, so no statements were executed.
|
||||
See https://bitbucket.org/liamstask/goose/overview for details.`)
|
||||
|
|
Loading…
Reference in New Issue