yogthos / migratus

MIGRATE ALL THE THINGS!
640 stars 95 forks source link

Suggestion: print a warning if a command might contain multiple statements #258

Open aviflax opened 7 months ago

aviflax commented 7 months ago

My Clojure is a little rusty so I can’t open a PR for this right now, but I’d like to at least make this suggestion because I just lost an hour trying to debug why my giant migration wasn’t working… turns out my migration contained dozens of statements as a single “command” — i.e. it wasn’t using the delimiter that is required as per the readme.

My rationale for this suggestion is that:

yogthos commented 7 months ago

That sounds reasonable to me, could do a a heuristic check on the sql file content to see if it looks like it has multiple statements in it and warn. I've been bitten by this myself before actually, so I definitely understand the pain here. :)