KandraMigrationRunner

class KandraMigrationRunner(session: CqlSession)

Applies versioned KandraMigrations to a ScyllaDB keyspace.

Maintains a kandra_migrations table to track which migrations have been applied. Migrations are executed in ascending version order. Already-applied migrations are skipped. If a previously-applied migration's checksum no longer matches, KandraMigrationException is thrown.

fun Application.configureMigrations() {
val runner = KandraMigrationRunner(kandraSession)
runner.run(V1_CreateUsers, V2_AddPhoneToUsers)
}
// Call BEFORE install(Kandra) with schemaMode = NONE for migration-managed schemas

Constructors

Link copied to clipboard
constructor(session: CqlSession)

Functions

Link copied to clipboard

Returns the full history of applied migrations.

Link copied to clipboard
fun run(vararg migrations: KandraMigration)