Flyway CLI
$ flyway Official Med RiskFlyway by Redgate applies versioned SQL (V1__...sql) and repeatable migrations across major relational databases. Supports -outputType=json for status/info parsing, flyway validate, and non-interactive CI execution via FLYWAY_* environment variables.
brew install flyway flyway runs deterministic versioned SQL file checks and migrations directly from a repo's sql/ directory without needing MCP.
Agent-Readiness Checklist
Static evaluation (not yet probed on this host). Run npm run data:probe locally to capture live verification.
FCRS-1.0 6-Dimension Breakdown
Supports -outputType=json, FLYWAY_* env vars, and deterministic info/validate/migrate commands, though Java-style -key=value flags differ from POSIX conventions.
- Supports
-outputType=jsonandFLYWAY_*env vars
Checksum validation prevents silent migration tampering, though flyway clean drops schemas if cleanDisabled is not set and -dryRunOutput is commercial-only.
- Checksum verification via
validate;-dryRunOutputgated behind paid edition
Available via Homebrew and archives across macOS, Linux, and Windows, bundled with JVM/drivers.
- Packaged via Homebrew and tarballs with JVM runtime overhead
Simple, battle-tested convention for SQL-first versioned migrations.
- Standard
V<version>__<desc>.sqlworkflow across major RDBMS
Official flyway/flyway maintained by Redgate with Community and commercial editions.
- Official
flyway/flywayrepository
Detailed Redgate documentation, though edition gating between Community and Teams requires attention.
- Official docs at documentation.red-gate.com
Security, Auth & Guardrails
Database URL and credentials configured via flyway.toml/flyway.conf or FLYWAY_URL, FLYWAY_USER, FLYWAY_PASSWORD env vars.
Community Edition is free/Apache-2.0; dry-run SQL output (-dryRunOutput), undo migrations, and Teams/Enterprise features require paid Redgate tiers.
# Flyway CLI Agent Rules - Always run `flyway info -outputType=json` and `flyway validate` before `flyway migrate`. - Pass credentials via `FLYWAY_URL` / `FLYWAY_PASSWORD` env vars, not command arguments. - NEVER run `flyway clean` (it drops all objects in configured schemas).
Agent-Ready Command Recipes
Safe Read-Only Queries
flyway info -outputType=json
Reports applied, pending, and failed migrations in structured JSON.
flyway validate -outputType=json
Verifies local SQL migration checksums match the database schema history table.
Controlled Writes & Previews
flyway baseline -baselineVersion=1
Initializes Flyway's history table on an existing database without executing V1 DDL.
Strengths for Agents
- +
-outputType=jsonmakesflyway infoandvalidateeasy for agents to parse. - + Simple SQL-first naming (
V1__init.sql) requires no proprietary DSL. - + Built-in checksum validation detects out-of-band migration edits.
Caveats & Pitfalls
- !
-dryRunOutputand undo (flyway undo) are commercial features unavailable in Community Edition. - !
flyway cleanis catastrophic if enabled on non-dev databases; ensurecleanDisabled=true.