A general migration framework for Clojure supporting SQL and code-based migrations, designed for git workflows.
Migratus is a migration framework for Clojure applications that manages database schema changes and data transformations. It supports both SQL scripts and Clojure code-based migrations, ensuring they are applied exactly once and in the correct order, even in complex git workflows with multiple branches.
Clojure developers and teams who need a reliable way to manage database migrations in applications, especially those working in distributed environments with frequent branching and merging.
Developers choose Migratus for its compatibility with git workflows, support for both SQL and programmatic migrations, and robust handling of migration dependencies without relying on sequential integer IDs.
MIGRATE ALL THE THINGS!
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Uses 14-digit timestamps instead of sequential integers to avoid collisions in distributed teams, as recommended in the README, ensuring reliable merging in git workflows.
Treats each migration independently, allowing non-linear branch merging without skipping migrations, which is explicitly designed for unpredictable merge orders.
Supports both SQL scripts and Clojure code-based migrations via .edn files, enabling programmatic data transformations for complex scenarios like backfilling from external systems.
Runs migrations within transactions by default with an opt-out (-- :disable-transaction) for databases that don't support transactional DDL, balancing safety and flexibility.
Allows placeholders like ${property.name} in migration files, replaced with environment variables or custom properties, simplifying configuration across different deployments.
Tightly coupled to Clojure and the JVM, making it unusable for projects in other languages, which limits its adoption in polyglot environments.
As admitted in the README, some databases like MySQL do not fully support transactional DDL, complicating rollbacks and requiring manual intervention or workarounds.
Requires a detailed config map setup and understanding of Clojure dependencies (e.g., Leiningen or deps.edn), which can be overwhelming for developers new to the Clojure ecosystem.
Lacks advanced features like migration squashing or GUI interfaces out-of-the-box; while squashing is supported via functions, it's not as streamlined as in some competing tools.