SQL migrations lacking any 'Up' or 'Down' directives fail silently
Issue #3
resolved
I got surprised today that my migration wasn't running when goose said it was.
If an SQL migration doesn't have any direction directives (but does have statements), goose runs no statements and returns success.
I understand why this is (after some digging), but I found it pretty surprising.
If there are no direction statements in an SQL migration, would it make sense to assume that the developer either A) wants every statement to run, or B) has made a mistake and left the directives out (and needs a usage message)
Comments (2)
-
repo owner -
repo owner - changed status to resolved
sql migration: diagnose scripts that have no Up/Down annotations. fixes
#3→ <<cset bb38ea25542e>>
- Log in to comment
Ah, good one.
I'd tend to want to issue an error/warning to encourage the developer to explicitly add an Up section at the very least. If they decide not to add a Down section, at least they've done so in a slightly more informed way :)