yogthos/migratus

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

Ouverte

#258 ouverte le 6 déc. 2023

 (3 commentaires) (0 réaction) (0 personne assignée)Clojure (99 forks)github user discovery
enhancementhelp wanted

Métriques du dépôt

Stars
 (686 étoiles)
Métriques de merge PR
 (Métriques PR en attente)

Description

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:

  • This just cost me an hour, and while I am rusty with Clojure, I am pretty experienced
  • I’ve found multiple other issues opened by people who encountered this problem over the years
    • it’s just very easy to miss that bit in the readme
    • especially since some other migrations frameworks do support multiple statements in a single .sql file
  • I would think it could be fairly easy to implement
    • e.g. something as simple as checking whether a command contains two or more instances of a semicolon followed by a linefeed might be helpful

Guide contributeur