kaaveland / eugene

Careful With that Lock, Eugene
MIT License
32 stars 1 forks source link

Making flyway-sorting across multiple folders work like flyway #81

Closed kaaveland closed 4 months ago

kaaveland commented 4 months ago

If provided with multiple folders, eg. sql1/ and sql2/, eugene lint --sort-mode=auto and eugene trace --sort-mode=auto (the default) will version sort sql1, then sql2, and concatenate the results. Flyway does this differently and will version sort across both paths. Example:

/sql1
  - V4__bar.sql
  - V1__foo.sql
/sql2
  - V3__lorem.sql
  - V2__snafu.sql

For these, flyway would apply as V1 -> V2 -> V3 -> V4 and eugene would do V1 -> V4 -> V2 -> V3. This is simple to fix, it's just a misunderstanding of how flyway works that lead me to do it this way.