OctaviusMigrator
class 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" }Content copied to clipboard
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.