Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

migration error message unhelpful when name contains _ #3075

Closed
wcarmon opened this issue Feb 24, 2024 · 1 comment
Closed

migration error message unhelpful when name contains _ #3075

wcarmon opened this issue Feb 24, 2024 · 1 comment
Labels

Comments

@wcarmon
Copy link

wcarmon commented Feb 24, 2024

Bug Description

If one of your migration file names contains _ (underscore),

sqlx migrate run produces this unhelpful error message:

error: while resolving migrations: invalid digit found in string

Minimal Reproduction

  1. create file in any project with a postgres database $PROJECT_ROOT/migrations/000.crate_foo_table.sql
  2. add any valid create table sql statement (failure happens before parsing this so it doesn't matter)
  3. run sqlx migrate run
  4. notice the same error message above

Info

Cargo.toml has:

sqlx = { version = "0.7.3", features = ["runtime-tokio", "chrono", "macros", "postgres"] }
  • SQLx version: 0.7.3
  • SQLx features enabled: "runtime-tokio", "chrono", "macros", "postgres"
  • Database server and version: Postgres 16.1 (via docker image: postgres:16.1)
  • Operating system: Linux Mint, uname -r = 5.15.0-82-generic
  • rustc --version: rustc 1.78.0-nightly (1a648b397 2024-02-11)

Suggested fixes:

  1. include the the failing string (in this case, the failing migration file name) (or maybe first 32 chars)
  2. include the failing character (in this case it is _ meaning underscore)
@wcarmon wcarmon added the bug label Feb 24, 2024
@abonander
Copy link
Collaborator

Fixed by #3089

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants