golang-migrate
$ migrate Community High Riskgolang-migrate (migrate) applies versioned .up.sql and .down.sql migrations across PostgreSQL, MySQL, SQLite, ClickHouse, MongoDB, and Cassandra. Ships as a fast single Go binary supporting up N, down N, version, and force for dirty-state recovery.
brew install golang-migrate migrate executes ordered local .sql migration files directly against a target database DSN; MCP adds unnecessary indirection.
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
Deterministic non-interactive CLI (up, down, version, create) with clear exit codes, though output is plain text with no --json or --dry-run.
- Non-interactive subcommands; no
--jsonor--dry-runsupport
Marks failed migrations as dirty to prevent cascading corruption, though unbounded migrate down prompts only on TTY and drop/force are dangerous if misused.
- Dirty-version lock prevents partial replays;
dropand unboundeddowncarry high risk
Single static Go binary available via Homebrew, Go install, and GitHub Releases across macOS, Linux, and Windows.
- Static Go binary via
brew install golang-migrate
Supports broad SQL and NoSQL drivers plus remote sources (GitHub, S3, GCS) in one small binary.
- Multi-DB support including Postgres, MySQL, SQLite, ClickHouse, and MongoDB
Widely used community standard (golang-migrate/migrate) under MIT license.
- Standard Go migration repository under MIT
Clear CLI README and driver docs in the repository.
- Documented at github.com/golang-migrate/migrate
Security, Auth & Guardrails
Reads target DSN from -database "$DATABASE_URL" (with env expansion in scripts) and migration source paths from -path or S3/GCS URLs.
100% free and MIT open-source.
# golang-migrate (migrate) Agent Rules - Always run `migrate -path ... -database "$DATABASE_URL" version` before `up`. - Prefer step-bounded `down 1` instead of unbounded `down` (unbounded `down` rolls back every migration). - NEVER run `migrate drop` or `migrate force` without inspecting the failed DDL and getting approval.
Agent-Ready Command Recipes
Safe Read-Only Queries
migrate -path ./migrations -database "$DATABASE_URL" version
Prints the active migration version and fails cleanly if the database is in a dirty state.
Controlled Writes & Previews
migrate -path ./migrations -database "$DATABASE_URL" up
Runs all unapplied .up.sql migrations in ./migrations against $DATABASE_URL.
Strengths for Agents
- + Fast single Go binary supporting SQL and NoSQL engines with paired
.up.sql/.down.sqlfiles. - + Tracks
dirtystate automatically so failed migrations halt safely before further changes.
Caveats & Pitfalls
- ! Lacks
--jsonoutput and--dry-runSQL preview. - ! Running
migrate downwithout a step count rolls back all migrations;go installrequires driver build tags.