Consider documenting migration naming requirements
Unless I'm mistaken, it isn't documented that migration files must be named N_X.sql, where N is a number greater than 0, and X is the name of the migration.
Hello!
I think it's defined here: https://github.com/launchbadge/sqlx/tree/master/sqlx-cli#create-and-run-migrations
But yes we can make it more explicit. Feels free to open a PR to add it to the documentation!
Just to add on to this, I was using an older version of sqlx-cli to run my migrations, and was able to have a migration with version "0". I'm not a fan of the timestamp personally since I find them hard for humans to read, so I was using 000, 001, 002...
I updated my CLI recently and that became a large problem. Not a big deal, but I figure others might run into this as well.
Any number should work as long they are incrementing. If it doesn't, that sounds like a bug. The timestamp is not required, only the default way the cli tool generates migration files.
I just tried replicating, and I received the same error:
error: migration 0 was previously applied but is missing in the resolved migrations
If I switch my migration named 000_initial.sql to 001_initial.sql everything works as intended. I apologize that I can't recall which version I was using previously of sqlx-cli, but I can say for certain it was working at some point and with the latest release it is not. Not a huge burden for me personally, but if I find some time I'd be happy to dig around and see if I can figure out what changed.