# golang-migrate

> Database migrations as a CLI and Go library

Source: https://talira.ai/catalog/golang-migrate-pey7g13m
Every listing: https://talira.ai/catalog.md

- Kind: Open source
- Types: Command-line tool, Library
- Categories: [developer tools / database / migrations](https://talira.ai/categories/developer-tools/database/migrations)
- Licence: MIT[^3]
- Pricing: Free and open source[^3]
- Free tier: yes[^3]
- Backed by: [golang-migrate](https://talira.ai/orgs/golang-migrate.md)

golang-migrate (migrate) runs database migrations, as a command-line tool or a library imported into a Go program. It reads migrations from sources such as local files, embedded files, GitHub, S3 and Google Cloud Storage and applies them in order to more than twenty databases, including PostgreSQL, MySQL and MariaDB, SQLite, SQL Server, MongoDB, ClickHouse, CockroachDB, Cassandra, Spanner and Redshift, each through a deliberately simple driver that fails rather than guesses. Databases are given as connection URLs. It was forked from mattes/migrate and is MIT licensed.

## Links

- GitHub: https://github.com/golang-migrate/migrate

## Ways to install

### Package managers

- [Homebrew](https://talira.ai/catalog/homebrew-djy17yn9.md): <https://formulae.brew.sh/formula/golang-migrate>[^1]
- [mise](https://talira.ai/catalog/mise-0axr08xw.md): <https://mise-versions.jdx.dev/tools/gomigrate>[^2]

## Problems it solves

- run versioned SQL migrations against Postgres when my Go service starts
- a migration CLI that works the same for MySQL and Postgres in CI
- embed migration files in my Go binary and apply them on deploy

## Features

- CLI and Go library
- drivers for PostgreSQL, MySQL, SQLite, SQL Server, MongoDB, ClickHouse and more
- migration sources: files, embedded files, GitHub, S3, GCS
- separate up and down migration files
- database given as a connection URL

## Trust

Overall: 0.62 out of 1.
Signals: maintenance 0.67, adoption 0.86, momentum 0.68, community 0.98, backing 0.30, extensibility 0.00.

- last commit 14 days ago
- 10 commits in the last 90 days
- latest release v4.20.1 2 months ago
- 19.1k GitHub stars
- 275 contributors
- 1k Homebrew installs in 30 days
- has a company behind it

## Alternatives

- [Flyway](https://talira.ai/catalog/flyway-nkthpjjz.md): Versioned SQL database migrations for 50+ databases, open source with Redgate's enterprise editions
- [dbmate](https://talira.ai/catalog/dbmate-q0nv00j1.md): A lightweight, framework-agnostic database migration tool for plain SQL migrations
- [Atlas](https://talira.ai/catalog/atlas-vjsak9tx.md): Database schema as code: plan, lint, test and apply schema migrations, like Terraform for databases
- [pgroll](https://talira.ai/catalog/pgroll-gdjd3cnf.md): Zero-downtime, reversible schema migrations for Postgres
- [Reshape](https://talira.ai/catalog/reshape-g9t6827t.md): An easy-to-use, zero-downtime schema migration tool for Postgres
- [goose (database migrations)](https://talira.ai/catalog/goose-database-migrations-cbmxye2d.md): Database migration tool for SQL files and Go functions

## Sources

[^1]: https://formulae.brew.sh/api/formula.json (checked 26 Nov 2026)
[^2]: https://mise-versions.jdx.dev/tools.json (checked 26 Nov 2026)
[^3]: https://github.com/golang-migrate/migrate/blob/master/LICENSE (checked 26 Nov 2026)
