Flyway

Command-line - repair

Command-line: repair

Repairs the Flyway 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
    • As a result, repair must be given the same locations as migrate!

repair

Usage

> flyway [options] repair

Options

See configuration for a full list of supported configuration parameters.

Sample output

> flyway repair

Flyway 11.0.0 by Redgate

Repair not necessary. No failed migration detected.

Sample JSON output

> flyway repair -outputType=json

{
  "repairActions": [
    "ALIGNED APPLIED MIGRATION CHECKSUMS"
  ],
  "migrationsRemoved": [],
  "migrationsDeleted": [],
  "migrationsAligned": [
    {
      "version": "1",
      "description": "first",
      "filepath": "C:\\flyway\\sql\\V1__first.sql"
    }
  ],
  "flywayVersion": "11.0.0",
  "database": "testdb",
  "warnings": [],
  "operation": "repair"
}

Didn't find what you were looking for?