Integrant methods for running database migrations using Ragtime.
Add the following dependency to your deps.edn file:
org.duct-framework/migrator.ragtime {:mvn/version "0.6.0"}
Or to your Leiningen project file:
[org.duct-framework/migrator.ragtime "0.6.0"]
This library provides the :duct.migrator/ragtime Integrant key,
which takes five options:
{:duct.migrator/ragtime
{:database #ig/ref :duct.database/sql
:logger #ig/ref :duct/logger
:strategy :rebase
:migrations [...]
:migrations-table "ragtime_migrations"}}The :database key should be a SQL database compatible with the Duct
database.sql library, such as database.sql.hikaricp:
{:duct.database.sql/hikaricp {:jdbcUrl "jdbc:sqlite:db/foo.sqlite"}}The :logger key should be a logger compatible with the Duct
logger library, such as [logger.simple][]:
{:duct.logger/simple {:appenders [{:type :stdout}]}}The :strategy is either :apply-new, :raise-error or
:rebase. These correspond to the ragtime strategies with the
same names.
A data structure containing a vector of Ragtime SQL migrations. As
this can be large, it may be a a good idea to factor this out using the
#duct/include reader tag, or an equivalent.
Finally, the :migrations-table optional key corresponds
to the ragtime sql-database option with the same name. It is the
name of the table to store the applied migrations (defaults to
"ragtime_migrations" if not specified).
Copyright © 2025 James Reeves
Distributed under the Eclipse Public License either version 1.0 or (at your option) any later version.