Skip to content
Latchkey

flyway info: Migration Status in Pipelines

flyway info prints a table of every migration with its version, description, and state (Pending, Success, or Failed).

info is the read-only status command. Run it before migrate to see what will change, or after a failure to see where the schema history stopped.

What it does

flyway info lists all migrations Flyway knows about, both on disk and in the schema history table, with each one marked Pending, Success, Failed, or Missing. It changes nothing, so it is safe to run anywhere.

Common usage

Terminal
flyway -url=jdbc:postgresql://db:5432/app \
  -user=ci -password="$DB_PASSWORD" info

# machine-readable output for a pipeline gate
flyway -configFiles=flyway.conf info -outputType=json

Options

FlagWhat it does
-outputType=jsonEmit JSON instead of the ASCII table
-url / -user / -passwordConnection details
-locations=<list>Migration locations to report on
-infoSinceDate / -infoUntilVersionFilter the reported range

In CI

Use info -outputType=json and parse it to fail a pre-deploy check when unexpected Pending migrations exist, or to confirm the previous deploy left no Failed entry. It never mutates the database, so it is safe in a read-only verification stage.

Common errors in CI

"Unable to obtain connection from database" means the JDBC url, host, or credentials are wrong, or the database is not reachable from the runner. "No migrations found. Are your locations set up correctly?" means -locations does not point at the migration files, a common issue when the working directory differs in CI.

Related guides

Run this faster and cheaper on Latchkey managed runners. Start free →