finds.dev← search

// the find

golang-migrate/migrate

★ 18,666 · Go · NOASSERTION · updated Mar 2026

Database migrations. CLI and Golang library.

golang-migrate is the de facto standard for database migrations in Go — a CLI and library that reads numbered SQL files and applies them in order, with drivers for 20+ databases and sources including S3, GitHub, and GCS. It's deliberately minimal: no config files, no magic, just numbered up/down files and a clean API. If you're writing Go and need migrations that aren't tied to a specific ORM, this is the obvious starting point.

The driver architecture is clean — database and source drivers are separate interfaces, so you can point it at migrations stored in S3 and apply them to CockroachDB without any core changes. The API is genuinely stable: v4 has been frozen for years and the import path hasn't changed. Thread-safe by design with graceful stop support via a channel, which matters for migrations running inside a server startup path. The breadth of database support (Postgres, MySQL, MongoDB, Spanner, ClickHouse, MS SQL) means you can reuse the same tooling and mental model across different projects.

Down migrations are a first-class concept but in practice they're almost never safe to write and the project doesn't help you think through why — you get the mechanism, not the guidance. The MySQL driver has historically had subtle issues with advisory locks and multi-statement transactions that have caught people in production; it's improved but still worth reading the driver README carefully before trusting it. No built-in support for migration checksums or drift detection — if someone edits an already-applied migration file, nothing will tell you. The io/fs source driver exists but embedding migrations at compile time requires some wiring that isn't as obvious as it should be from the docs.

View on GitHub →

// want more like this?

We dig through GitHub every week and send a few repos picked for what you actually care about — each with an honest take like this one.

Get finds in your inbox → Search again →