Back to Flyway

Check

documentation/Reference/Commands/Check.md

latest2.4 KB
Original Source

Description

The check command encapsulates the following operations:

ParameterEditionDescription
check -driftEnterpriseCheck for unexpected modifications to a database.
check -changesEnterpriseGenerate a report of pending changes to a database.
check -dryrunTeams & EnterprisePerform a dry run, generating a deployment script representing what will be run when deployment is executed.
check -codeAllRun code analysis on your migrations.

check produces a report file that contains the results of the operation.

You might want this to:

  • Have a record of what the check results were for audit or reporting purposes
  • Understand and be able to communicate status and plans in a more easily shareable manner

The reports from the separate operations will all be added to the same report file (under corresponding tabs for the html report), whether they are in the same command invocation or spread across multiple invocations. If the same operation is run again, then the entry for that report type will be replaced within the report file, so there is only ever one entry for each report type. So if you run check -drift twice in a row, the second report entry will overwrite the first.

When check is called with both -drift and -changes flags, -drift will be run before -changes for build efficiency.

Usage examples

Generating change & drift reports

bash
flyway check -changes -drift -buildEnvironment="build" -environment="production"
bash
flyway check -drift -environment="production"
flyway check -changes -buildEnvironment="build" -environment="production"