documentation/Reference/Commands/Check/Check Code.md
The check -code command runs static code analysis over your SQL migrations from filesystem: Locations.
See Code Analysis for more information.
flyway check -code
| Parameter | Namespace | Description |
|---|---|---|
rulesLocation | check | Where Flyway looks for rules. |
rulesConfig | check | Where to locate the SQLFluff configuration file. |
rulesDialect | check | Specifies the SQL dialect for analysis. |
scope | check | Specifies the scope of migration files to include in code analysis |
regexEnabled | check | Enable or disable the Regex Engine for code analysis. |
sqlfluffEnabled | check | Enable or disable the SQLFluff Engine for code analysis. |
code.failOnError | check | Whether to fail based on the violation severity level. |
reportFilename | (root) | The output path of the generated report. |
workingDirectory | (root) | The directory to consider the current working directory. All relative paths will be considered relative to this. |
| {environment parameters} | (root) | Environment configuration for the source and/or target environments. |
Universal commandline parameters are listed here.
Note:
failOnError is enabled, Flyway will continue processing the remaining verb operations.
For this reason, it is recommended to run subsequent Flyway verbs separately.{
"individualResults" : [ {
"timestamp" : "2026-02-03T15:35:14.170951075",
"operation" : "code",
"exception" : null,
"licenseFailed" : false,
"results" : [ {
"filepath" : "/projects/flyway/sql/V1__no_where.sql",
"violations" : [ {
"line_no" : 1,
"line_pos" : 1,
"line_no_end" : 1,
"line_pos_end" : 18,
"description" : "Ensure delete statements have a condition attached.",
"code" : "RG06",
"warning" : false,
"help" : "https://help.red-gate.com/help/flyway-cli12/help_0.aspx?topic=rules/RG06"
} ]
} ]
} ]
}
This command can produce the following error codes: