Back to Flyway

Info

documentation/Reference/Commands/Info.md

latest4.4 KB
Original Source

Description

Prints the details and status information about all the migrations.

See Flyway Schema History Table for more information.

Usage examples

Info via command line

bash
flyway info -infoSinceDate="01/12/2020 13:00"

Info via Maven

bash
mvn flyway:info

Info via Gradle

bash
gradle flywayInfo

Parameters

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 info command:

  • General settings
  • Migration location and naming settings
  • Flyway schema history settings
  • Settings in database-specific namespaces
  • Settings in secrets management namespaces

It is also possible to set environment settings as parameters.

The following parameters are also available:

ParameterDescription
infoSinceDateLimits info to show only migrations applied after this date, and any pending migrations. Must be in the format dd/MM/yyyy HH:mm (e.g. 01/12/2020 13:00)
infoUntilDateLimits info to show only migrations applied before this date. Must be in the format dd/MM/yyyy HH:mm (e.g. 01/12/2020 13:00)
infoSinceVersionLimits info to show only migrations greater than or equal to this version, and any repeatable migrations. (e.g 1.1)
infoUntilVersionLimits info to show only migrations less than or equal to this version, and any repeatable migrations. (e.g. 1.1)
infoOfStateLimits info to show only migrations of the provided states. This is a case insensitive, comma-separated list. The valid states can be found at Migration States.
migrationIdsSuppresses all other output and displays a comma-separated list of migration versions for versioned migrations and descriptions for repeatable migrations. This is equivalent to the expected input to cherryPick

All parameters are optional, although a target environment must be configured or passed in.

JSON output format

json
{
  "schemaVersion": null,
  "schemaName": "public",
  "migrations": [
    {
      "category": "Versioned",
      "version": "1",
      "description": "first",
      "type": "SQL",
      "installedOnUTC": "",
      "state": "Pending",
      "undoable": "No",
      "filepath": "C:\\flyway\\sql\\V1__first.sql",
      "installedBy": "",
      "executionTime": 0
    },
    {
      "category": "Repeatable",
      "version": "",
      "description": "repeatable",
      "type": "SQL",
      "installedOnUTC": "",
      "state": "Pending",
      "undoable": "",
      "filepath": "C:\\flyway\\sql\\R__repeatable.sql",
      "installedBy": "",
      "executionTime": 0
    }
  ],
  "allSchemasEmpty": false,
  "flywayVersion": "{{ site.flywayVersion }}",
  "database": "testdb",
  "warnings": [],
  "operation": "info"
}

Error codes

This command can produce the following error codes: