OctaviusMigrator

Brings a database up to date with the migrations in this application.

val report = OctaviusMigrator(
dataSource,
MigratorConfig(
sqlLocations = listOf("db/migration"),
codePackages = listOf("com.roma.migrations")
)
).migrate()

logger.info { "Octavius: $report" }

A run holds one session, and an advisory lock from before the history table is read until after the last migration, so two instances starting together run once and wait once.

There is no undo: a migration that turns out to be wrong is corrected by one that comes after it.

Constructors

Link copied to clipboard
constructor(dataSource: DataSource, config: MigratorConfig = MigratorConfig())

Types

Link copied to clipboard
object Companion

Functions

Link copied to clipboard

What the run would do, without doing any of it.

Link copied to clipboard

Applies every migration this database has not run, in version order.