db.migrate

Database migration utilities using Ragtime.

*migrations-path*

dynamic

Resource path for migrations. Defaults to "migrations". Bind this to use a different path, e.g., "bashketball-editor-api/migrations".

do-with-config

(do-with-config thunk)

Executes a function with Ragtime configuration bound to *ragtime-config*.

Takes a thunk (function of zero arguments) and executes it with a Ragtime configuration that uses db/*datasource* and loads migrations from the path specified by *migrations-path*. Returns the return value of the thunk, or nil if an error occurs (errors are logged).

migrate

(migrate)(migrate config)

Applies all pending migrations.

When called with no arguments, uses the default configuration from *datasource* and the migrations resource directory. When called with a Ragtime config map, uses that configuration instead. Returns nil.

rollback

(rollback)(rollback config)

Rolls back the last applied migration.

When called with no arguments, uses the default configuration from *datasource* and the migrations resource directory. When called with a Ragtime config map, uses that configuration instead. Returns nil.

with-config

macro

(with-config & body)

Execute body with Ragtime configuration bound to ragtime-config.