- Notifications
You must be signed in to change notification settings - Fork 1.5k
Closed
Labels
E-easycliConcerns `sqlx-cli`Concerns `sqlx-cli`enhancementNew feature or requestNew feature or requestmigrationsProposals or bugs involving migrationsProposals or bugs involving migrations
Description
$ sqlx --version sqlx-cli 0.2.0 $ git rev-parse --short=12 HEAD 7f1bff406d94
Related to:
- issue [cli] should validation all previously run migration files before running new migrations and prove they have not been modified #358 (introduced checksum column)
Related tangentially to:
- issue [cli]
sqlx migrate run
should support--dry-run
#357 (--dry-run
support forsqlx migrate run
)
It would be useful to have sqlx migrate info
warn the user about migrations whose file checksum no longer matches the value recorded in the db, similar to how sqlx database setup
does.
For example, if I:
sqlx database setup
- change the migration file
sqlx database setup
Upon the second setup invocation an error is emitted:
error: migration 20201202222356 was previously applied but has been modified
That's quite nice.
From the perspective of treating the sqlx migrate info
command as the thing to use to answer the question, "Where does the database stand with respect to the available migrations?", it would be nice if it were able to provide similar information. Currently it shows that the migration was successfully installed at some point in the past, but does not give any indication that the migration script has been modified:
$ sqlx migrate info 20201202222356/installed name-of-migration
Metadata
Metadata
Assignees
Labels
E-easycliConcerns `sqlx-cli`Concerns `sqlx-cli`enhancementNew feature or requestNew feature or requestmigrationsProposals or bugs involving migrationsProposals or bugs involving migrations