Repolode
amacneil

amacneil/dbmate

A lightweight, framework-agnostic command-line tool for managing plain SQL database migrations across teams and environments.

スター
7,465
フォーク
385
未解決の Issue
31
最終コミット
13 時間前

これは何?

Dbmate keeps a database schema in sync across developers and production servers by running timestamp-versioned SQL migration files. It ships as a standalone binary, so it can be used alongside Go, Node.js, Python, Ruby, PHP, Rust, C++, or any other stack that talks to a supported database.

Migrations are written as plain SQL with `migrate:up` and `migrate:down` sections in one file. Each migration runs inside a transaction by default, and applied versions are recorded in a `schema_migrations` table. Dbmate can also dump the resulting schema to a `schema.sql` file so schema changes show up as readable diffs in git.

The tool supports PostgreSQL, MySQL, MariaDB, SQLite, ClickHouse, BigQuery, and Spanner through its PostgreSQL interface. Connection details come from a `DATABASE_URL` variable or a `.env` file, and commands include create, drop, wait for the database to become ready, and rollback.

主な機能

  • 01Plain SQL migration files with up and down sections
  • 02Timestamp-versioned migrations to avoid version conflicts between developers
  • 03Migrations run atomically inside a transaction by default
  • 04Dumps a schema.sql file for reviewing schema changes in version control
  • 05Reads connection URLs from environment variables or a .env file

ユースケース

  • Keeping schema changes in sync across a team working on one application
  • Managing migrations for several services written in different languages
  • Creating and dropping test databases in CI before running a test suite
  • Running migrations in production or in containers with a wait-for-database step

トピック

よくある質問

dbmate とは?
A lightweight, framework-agnostic command-line tool for managing plain SQL database migrations across teams and environments. Dbmate keeps a database schema in sync across developers and production servers by running timestamp-versioned SQL migration files. It ships as a standalone binary, so it can be used alongside Go, Node.js, Python, Ruby, PHP, Rust, C++, or any other stack that talks to a supported database.
dbmate は無料で使えますか?ライセンスは?
dbmate は MIT ライセンスのオープンソースです。商用製品で使う前にライセンス条件を確認してください。
dbmate は今もメンテナンスされていますか?
活発にメンテナンス中。dbmate の最終コミットは 2026年10月18日 です。
dbmate は何に使えますか?
Keeping schema changes in sync across a team working on one application Managing migrations for several services written in different languages Creating and dropping test databases in CI before running a test suite Running migrations in production or in containers with a wait-for-database step
dbmate はどこで入手できますか?
ソースコードとインストール手順は GitHub にあります:https://github.com/amacneil/dbmate

概要はプロジェクトの README をもとに AI が生成しています。GitHub の数値は毎日更新されます。

関連プロジェクト