SQL migrations lacking any 'Up' or 'Down' directives fail silently

Issue #3 resolved
Daniel Heath created an issue

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)

  1. Liam Staskawicz repo owner

    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 :)

  2. Log in to comment