documentation/Reference/Commands/Repair.md
Repairs the schema history table.
This will perform the following actions:
Remove any failed migrations
(User objects left behind must still be cleaned up manually)
Realign the checksums, descriptions and types of the applied migrations with the ones of the available migrations
Mark all missing migrations as deleted
repair must be given the same locations as migrate!For more information, see Flyway Schema History Table.
flyway repair
mvn flyway:repair
gradle flywayRepair
Universal commandline parameters are listed here.
All relevant configuration settings are listed here. The settings from these sections can be set as parameters on the repair command:
It is also possible to set environment settings as parameters.
All parameters are optional, although a target environment must be configured or passed in.
{
"repairActions": [
"ALIGNED APPLIED MIGRATION CHECKSUMS"
],
"migrationsRemoved": [],
"migrationsDeleted": [],
"migrationsAligned": [
{
"version": "1",
"description": "first",
"filepath": "C:\\flyway\\sql\\V1__first.sql"
}
],
"flywayVersion": "{{ site.flywayVersion }}",
"database": "testdb",
"warnings": [],
"operation": "repair"
}
This command can produce the following error codes: