Skip to content
SPECIFICTION
Get listed

golang-migrate

github.com

Free plan WindowsmacOSLinuxSelf-hosted
Visit github.com
Spec score 7.8 #15 of 32 in Database Migration Tools

What it is

golang-migrate reads database migrations from a source and applies them to a database in sequence. Each logical migration has an up file and a down file, and the tool can run as a command-line program or be imported as a Go library. Listed database drivers include PostgreSQL, MySQL/MariaDB, SQLite, MongoDB, Neo4j, CockroachDB, and Google Cloud Spanner. Migration sources include local files, embedded Go data, GitHub, GitLab, Bitbucket, AWS S3, and Google Cloud Storage. The CLI handles Ctrl+C gracefully and does not use config search paths, config files, or automatic environment-variable injection. The library uses io.Reader streams for low memory overhead, is described as thread-safe without goroutine leaks, and supports controlled stopping through a GracefulStop channel to help prevent database corruption. The project documents running the CLI in Docker with a mounted migration directory. golang-migrate is open source under the MIT License and costs nothing. The security policy marks master and 4.x as supported; 3.x and earlier are unsupported.

Spec sheet

Purpose
golang-migrate reads database migrations from sources and applies them to a database in order.Read 4 Oct 2026 · github.com
License
The project is distributed under the MIT License, which requires retaining the copyright and permission notices.Read 4 Oct 2026 · github.com
CLI behavior
The CLI handles Ctrl+C gracefully and has no config search paths, config files, or automatic environment-variable injections.Read 4 Oct 2026 · github.com
Database support
Listed database drivers include PostgreSQL, MySQL/MariaDB, SQLite, MongoDB, Neo4j, CockroachDB, and Google Cloud Spanner.Read 4 Oct 2026 · github.com
Docker
The README documents running the migrate CLI in Docker with a mounted migration directory.Read 4 Oct 2026 · github.com
Graceful stopping
The library supports graceful stops through a GracefulStop channel to help prevent database corruption.Read 4 Oct 2026 · github.com
Library compatibility
The README describes the v3 and v4 library API as stable and frozen for those releases.Read 4 Oct 2026 · github.com
Library properties
The README says the library uses io.Reader streams for low memory overhead and is thread-safe with no goroutine leaks.Read 4 Oct 2026 · github.com
Migration files
Each logical migration has an up file and a down file.Read 4 Oct 2026 · github.com
Migration sources
Sources include local filesystem, embedded Go data, GitHub, GitLab, Bitbucket, AWS S3, and Google Cloud Storage.Read 4 Oct 2026 · github.com
Security reporting
The security policy asks reporters to start a GitHub security advisory and suggest potential impact and urgency.Read 4 Oct 2026 · github.com
Supported versions
The security policy marks master and 4.x as supported, while 3.x and earlier are unsupported.Read 4 Oct 2026 · github.com
Ways to use
The project can be used as a command-line tool or imported as a Go library.Read 4 Oct 2026 · github.com

Plans and prices

Open source Free No paid plans or usage limits stated on the project pages opened Read 4 Oct 2026 · github.com

Every golang-migrate plan and price →

Strong points and limits

Strong points

  • Command-line tool and Go library
  • Supports a broad list of database drivers
  • Migration sources include cloud storage and Git providers
  • Graceful stopping helps prevent database corruption
  • Free and open source under the MIT License

Limits

  • 3.x and earlier are unsupported
  • MIT License requires retaining copyright and permission notices

Who it suits

It suits developers who need to apply and roll back database migrations from a command line or Go application. It may also suit teams that need a self-hosted tool with multiple database and migration-source options.

Verdict

golang-migrate provides migration execution and rollback through both a CLI and Go library, with a range of database drivers and sources. Check the supported-version policy and retain the required MIT License notices.

Where Specifiction places it

Alternatives to golang-migrateAll alternatives →