Directory Compare FCRS-1.0 /llms.txt
← Back to Directory

Flyway CLI

$ flyway Official Med Risk
Redgate · Database & Data · Apache-2.0 (Community) / Commercial · macos / linux / windows

Flyway 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.

FCRS-1.0 Score
77 /100
Good
Medium Confidence
Zero-Friction Install
brew install flyway
CLI vs MCP Decision CLI Only

flyway runs deterministic versioned SQL file checks and migrations directly from a repo's sql/ directory without needing MCP.

Agent-Readiness Checklist

✓ JSON Output
— Field Filtering
✓ Non-Interactive
✓ Dry-Run
— Read-Only Mode
— NO_COLOR Clean
✓ Self-Describing
— Official SKILL.md

Static evaluation (not yet probed on this host). Run npm run data:probe locally to capture live verification.

FCRS-1.0 6-Dimension Breakdown

Agent-Readiness 20 / 25

Supports -outputType=json, FLYWAY_* env vars, and deterministic info/validate/migrate commands, though Java-style -key=value flags differ from POSIX conventions.

  • Supports -outputType=json and FLYWAY_* env vars
Trust & Safety 19 / 25

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; -dryRunOutput gated behind paid edition
Setup & Portability 11 / 15

Available via Homebrew and archives across macOS, Linux, and Windows, bundled with JVM/drivers.

  • Packaged via Homebrew and tarballs with JVM runtime overhead
Utility & Efficiency 12 / 15

Simple, battle-tested convention for SQL-first versioned migrations.

  • Standard V<version>__<desc>.sql workflow across major RDBMS
Maintenance & Lineage 8 / 10

Official flyway/flyway maintained by Redgate with Community and commercial editions.

  • Official flyway/flyway repository
Docs & Verifiability 7 / 10

Detailed Redgate documentation, though edition gating between Community and Teams requires attention.

  • Official docs at documentation.red-gate.com

Security, Auth & Guardrails

Auth Modes
Config File Env API Key
Credential Storage

Database URL and credentials configured via flyway.toml/flyway.conf or FLYWAY_URL, FLYWAY_USER, FLYWAY_PASSWORD env vars.

Side Effects
Read-Only Remote Write Destructive
Cost & Quotas

Community Edition is free/Apache-2.0; dry-run SQL output (-dryRunOutput), undo migrations, and Teams/Enterprise features require paid Redgate tiers.

Copyable Guardrail for CLAUDE.md / AGENTS.md
# 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

Inspect migration status in JSON
flyway info -outputType=json

Reports applied, pending, and failed migrations in structured JSON.

Validate applied migration checksums
flyway validate -outputType=json

Verifies local SQL migration checksums match the database schema history table.

Controlled Writes & Previews

Create baseline migration marker on existing DB
flyway baseline -baselineVersion=1

Initializes Flyway's history table on an existing database without executing V1 DDL.

Strengths for Agents

  • + -outputType=json makes flyway info and validate easy 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

  • ! -dryRunOutput and undo (flyway undo) are commercial features unavailable in Community Edition.
  • ! flyway clean is catastrophic if enabled on non-dev databases; ensure cleanDisabled=true.

Tested Agent Hosts

Claude Code Codex CLI Gemini CLI