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

Add version infromation in sqlx migrate run output for failed migration #3129

Closed
FlakM opened this issue Mar 18, 2024 · 0 comments · Fixed by #3130
Closed

Add version infromation in sqlx migrate run output for failed migration #3129

FlakM opened this issue Mar 18, 2024 · 0 comments · Fixed by #3130
Labels
enhancement New feature or request

Comments

@FlakM
Copy link
Contributor

FlakM commented Mar 18, 2024

Is your feature request related to a problem? Please describe.

I wish I could see a version output of a migration that failed when running sqlx migrate run.
Currently only information about underlying problem is shown and no version or file name is shown in command output.

❯ sqlx migrate run
error: while executing migrations: error returned from database: column "email" of relation "customer_status_extended" already exists
❯ sqlx --version
sqlx-cli 0.7.4

It makes rapid iteration take longer since I have to check the failed migrations by running sqlx migrate info to get the latest migration in pending state.

Describe the solution you'd like
I'd like to see a information about the version that has caused the program to fail. Ie:

❯ sqlx migrate run
error: while executing migration 20240314125700: error returned from database: column "email" of relation "customer_status_extended" already exists

It would enable me to pinpoint specific file that caused a problem without running db query or running sqlx migrate info

Describe alternatives you've considered

  • enabling RUST_LOG=debug to see more verbose output (ie about partial state)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant