Ridgepole is a database schema management tool that treats your schema as code by expressing it in a Ruby DSL and applying diffs to keep databases in sync. You describe the desired state in a “Schemafile” (tables, columns, indexes, constraints), and Ridgepole compares it with the live database to generate only the necessary changes. This diff-and-apply approach makes schema changes repeatable and reviewable, avoiding hand-written migrations for routine structural edits. It supports multiple environments and options to ignore benign differences (such as auto-generated defaults), reducing churn in teams and CI pipelines. Dumps can be generated from an existing database, making it easy to adopt the tool on legacy systems and then evolve via code reviews. Used alongside application frameworks or standalone, Ridgepole offers a tidy workflow for versioning and promoting schema changes safely across development, staging, and production.
Features
- DSL for describing database schema: tables, columns, indexes, foreign keys etc in Ruby syntax rather than raw SQL or many migrations
- Ability to diff between current database schema and the schema file and generate migrations automatically or apply changes needed to bring the database in sync
- Support for multiple database adapters (e.g. MySQL, PostgreSQL, maybe others)
- Schema versioning / change tracking so that only required changes get applied (not wholesale drop and recreate)
- Safety features: e.g. warning about destructive changes (dropping columns/tables), ability to review diffs before applying
- Integration with Rails and migration systems, so you can use Ridgepole alongside or in place of regular migrations workflows in certain cases