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.5.0"}
Or to your Leiningen project file:
[org.duct-framework/migrator.ragtime "0.5.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-file "migrations.edn"
: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 path to an edn file containing a vector of Ragtime SQL migrations.
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 © 2024 James Reeves
Distributed under the Eclipse Public License either version 1.0 or (at your option) any later version.