Database Schema Migration

23 projects

Migration tools apply schema changes to a database in a controlled order and record which changes have run. There are two broad models. Versioned tools run numbered up and down scripts you write by hand. Declarative tools compare a desired schema with the live database and plan the change for you. Most can be used both as a CLI and as a library embedded in your Go binary.

golang-migrate/migrate is the most widely used versioned tool, with drivers for many databases and sources such as files, embed and cloud storage. pressly/goose supports SQL and Go-function migrations and works with io/fs, so migrations can ship inside the binary through the embed package. dbmate is a standalone, framework-agnostic CLI. Atlas from Ariga is declarative: you describe the schema in HCL, SQL or an ORM, and it computes and lints the migration. Skeema takes a similar pure-SQL approach for MySQL. Bytebase is a web platform for reviewing and rolling out schema changes across teams. gormigrate adds versioned migrations to GORM.

For a single service, goose or golang-migrate with embedded SQL files is a simple, reviewable setup. Choose Atlas when you want schema diffs, linting for destructive changes, or one source of truth shared with an ORM. Avoid relying on an ORM's automatic migration in production, because it rarely handles renames, data backfills or safe ordering.

migrateby golang-migrate

Database migrations. CLI and Golang library.

github.com/golang-migrate/migrate/v4Go 1.25+ 38 dependenciesv4.20.1updated 1mo ago

19k

bytebase

Safe database schema change and version control for DevOps teams.

github.com/bytebase/bytebaseGo 1.27+ 109 dependencies3.24.0updated today

14.7k

gooseby pressly

Database migration tool. You can manage your database's evolution by creating incremental SQL or Go scripts.

github.com/pressly/goose/v3Go 1.26+ 20 dependenciesv3.29.0updated 3d ago

11.7k

atlasby ariga

A Database Toolkit. A CLI designed to help companies better work with their data.

ariga.io/atlasGo 1.26+ 10 dependenciesv1.3.0updated 5d ago

8.8k

dbmateby amacneil

A lightweight, framework-agnostic database migration tool.

github.com/amacneil/dbmate/v2Go 1.26+ 11 dependenciesv2.37.0updated 5d ago

7.5k

sql-migrateby rubenv

Database migration tool. Allows embedding migrations into the application using go-bindata.

github.com/rubenv/sql-migrateGo 1.25+ 11 dependenciesupdated 3mo ago

3.4k

sodaby gobuffalo

Database migration, creation, ORM, etc... for MySQL, PostgreSQL, and SQLite.

github.com/gobuffalo/pop/v6/sodaGo 1.26+ v6.4.1updated 7d ago

1.5k

skeema

Pure-SQL schema management system for MySQL, with support for sharding and external online schema change tools.

github.com/skeema/skeemaGo 1.26+ 7 dependenciesv1.14.2updated 4d ago

1.4k

gormigrateby go-gormigrate

Database schema migration helper for Gorm ORM.

github.com/go-gormigrate/gormigrate/v2Go 1.18+ 1 dependencyv2.1.7updated 1mo ago

1.2k

goavroby linkedin

A Go package that encodes and decodes Avro data.

github.com/linkedin/goavro/v2Go 1.12+ 2 dependenciesv2.15.0updated 9mo ago

1.1k

migratorby lopezator

Dead simple Go database migration library.

github.com/lopezator/migratorGo 1.18+ 2 dependenciesv0.3.1updated 2y ago

179

darwinby GuiaBolso

Database schema evolution library for Go.

updated 3y ago

150

sqlizeby sunary

Database migration generator. Allows generate sql migration from model and existing sql by differ them.

github.com/sunary/sqlizeGo 1.25+ 4 dependenciesv1.0.0updated 8mo ago

125

go-pg-migrationsby robinjoseph08

A Go package to help write migrations with go-pg/pg.

github.com/robinjoseph08/go-pg-migrations/v3Go 1.23+ 4 dependenciesupdated 11mo ago

87

avroby khezen

Discover SQL schemas and convert them to AVRO schemas. Query SQL records into AVRO bytes.

github.com/khezen/avroGo 1.14+ 4 dependenciesv1.1.8updated 1y ago

49

schemaby adlio

Library to embed schema migrations for database/sql-compatible databases inside your Go binaries.

github.com/adlio/schemaGo 1.25+ 7 dependenciesv1.5.2updated 16d ago

44

go-fixturesby RichardKnop

Django style fixtures for Golang's excellent built-in database/sql library.

github.com/RichardKnop/go-fixtures4 dependenciesupdated 6y ago

32

migratorby larapulse

MySQL database migrator designed to run migrations to your features and manage database schema update with intuitive go code.

github.com/larapulse/migratorGo 1.13+ 2 dependenciesv1.2.1updated 1y ago

23

db-migrator.goby raoptimus

CLI for versioned database schema migrations with support for PostgreSQL, MySQL, ClickHouse, Tarantool, and Apache Iceberg.

github.com/raoptimus/db-migrator.goGo 1.26+ 10 dependenciesupdated 3mo ago

22

libschemaby muir

Define your migrations separately in each library. Migrations for open source libraries. MySQL & PostgreSQL.

github.com/muir/libschemaGo 1.24+ 7 dependenciesv0.14.0updated 19d ago

19

gorm-seederby Kachit

Simple database seeder for Gorm ORM.

github.com/kachit/gorm-seederGo 1.14+ 4 dependenciesv0.0.3updated 3y ago

18

godfishby rafaelespinoza

Database migration manager, works with native query language. Support for cassandra, mysql, postgres, sqlite3.

github.com/rafaelespinoza/godfishGo 1.26+ 8 dependenciesv0.18.1updated 13d ago

14

go-pg-migrateby lawzava

CLI-friendly package for go-pg migrations management.

github.com/lawzava/go-pg-migrate/v3Go 1.25+ No dependencies v3.0.1updated 3d ago

11
Esc

Type to search every entry. ↑↓ to move, Enter to open.