Open abeluck opened 5 years ago
I've updated the check for parsing the migration file names with a better heuristic to see whether the file was parsed correctly. Just pushed out 1.2.6
with the update that should help debugging the issue. Unfortunately, I just realized that it's a bit trickier than I originally thought. The file format is actually dependent on the specific migration implementation. For example, currently there's EDN and SQL file support. The EDN version can't have .
characters except to separate the extension, while the SQL version has to end with .up|down.sql
.
So, the proper fix here would be to select the file pattern based on the migration implementation being used. I'll try take a look at this when I get a chance, but a PR would be welcome as well.
When a migration file has a dot in the filename, migratus fails with some very unhelpful exceptions.
I ran into this while working on a new luminus project and spent a good 30 minutes debugging before I figured out the issue. Looks like this was the root cause in #152 as well, but the issue was never fixed.
If it's not desired to support dots in filenames, then perhaps the
create-migration
function could error or munge the dots and the migrate function should throw a helpful error message.The current error is: