revert target-version does not behave as expected
I maintainer di solito rispondono entro 4 giorni
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Idoneità per principianti
- 48/100
Direzione di ricerca
Start from sqlx-cli migrate revert versus migrate run and how --target-version is interpreted (the dry-run logs show revert skipping the named version while still reverting later ones). Trace the CLI option into the migration planner and compare the run path, which already applies the target and skips the rest. Done when revert --target-version N dry-run (and a real revert) stops at N the same way run does, with tests covering that ordering.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
I have found these related issues/pull requests
None
Description
If I use sqlx-cli (version 0.7.4) with command sqlx migrate revert --target-version <version>, my intended target is skipped and other migrations are reverted instead.
I posted this in discussions (#4218), but no replies in 4 days. After thinking about the logic for a few days, I think this may be an unintentional bug (seems unlikely because --target-version is a standard option for run or revert) or, at best, a poor user experience -- counterintuitive.
Reproduction steps
Opposite of what I expected:
steve@pop-os:~/Coding/rust_projects/webdev/bookmarks-rs$ sqlx migrate revert --dry-run --target-version 20240330153006 -D $DATABASE_URL/bookmarks
Can apply 20250905212818/revert test (0ns)
Can apply 20250428203929/revert mirror pinboard (0ns)
Skipped 20240330153006/revert use tag arrays (0ns)
It skips the target script, but reverts the others?
When I use the run command it behaves as I expected:
steve@pop-os:~/Coding/rust_projects/webdev/bookmarks-rs$ sqlx migrate run --dry-run --target-version 20240330153006 -D $DATABASE_URL/bookmarks
Can apply 20240330153006/migrate use tag arrays (0ns)
Skipped 20250428203929/migrate mirror pinboard (0ns)
Skipped 20250905212818/migrate test (0ns)
It runs the target and skips the others. I am showing my dry-run but the executed commands behaved the same.
Am I missing something? This revert behavior seems counterintuitive.
SQLx version
0.8.6
Enabled SQLx features
"runtime-tokio", "postgres", "tls-rustls", "chrono"
Database server and version
Postgres 18.3
Operating system
Pop_OS 22.04
Rust version
1.87.0
- Lingua principale
- Rust
- Stelle
- 17.5k
- Fork
- 1.7k
- Merge medio
- 1g 17h
- PR unite (30g)
- 7
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Ha un modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di transact-rs/sqlx
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 90/100
transact-rs/sqlx#4466 ·
I maintainer di solito rispondono entro 4 giorni
-
MySQL: ENUM and SET columns with a binary collation are named BINARY or CHARForse già presa @CodeMasterXZT l’ha presa 10 giorni fa. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
transact-rs/sqlx#4453 ·
I maintainer di solito rispondono entro 4 giorni
-
Postgres text arrays: a quoted "NULL" element is decoded as SQL NULLForse già presa @MinJaeRun l’ha presa 7 giorni fa. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
transact-rs/sqlx#4452 ·
I maintainer di solito rispondono entro 4 giorni
-
Fetch stream ends after first error using query macrosForse già presa @barry3406 l’ha presa 207 giorni fa. Apertabug
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
transact-rs/sqlx#4126 · 1 commento ·
I maintainer di solito rispondono entro 4 giorni
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 70/100
transact-rs/sqlx#3963 · 2 commenti ·
I maintainer di solito rispondono entro 4 giorni
Tutte le issue di transact-rs/sqlx
Issue simili
-
question
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 72/100
I maintainer di solito rispondono entro 1 giorno
-
autoindex tests: denied loopback bind shows only PermissionDenied (255 failures), not the causeApertafield-report
Difficoltà 2/5 1-3 ore Idoneità per principianti 70/100
I maintainer di solito rispondono entro 1 giorno
-
area:core
Difficoltà 2/5 1-3 ore Idoneità per principianti 85/100
julian-hemmer/ypass#4 ·
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 70/100
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 62/100
davidkodar/klipp#3426 ·
I maintainer di solito rispondono entro 1 giorno