Migrator

io.eezo.db.migrate.Migrator
object Migrator

The migration ledger and the migrations that fill it.

Every entry point takes a Tx, including the reading ones: applied ensures the ledger exists first, and creating a table is a write. Nothing here opens a scope of its own — a caller wraps the whole run in one transact, which is what makes a failed batch roll back including its ledger rows.

Attributes

Source
Migrator.scala
Graph
Supertypes
class Object
trait Matchable
class Any
Self type
Migrator.type

Members list

Type members

Classlikes

object Status

Attributes

Companion
trait
Source
Migrator.scala
Supertypes
trait Sum
trait Mirror
class Object
trait Matchable
class Any
Self type
Status.type
sealed trait Status

Attributes

Companion
object
Source
Migrator.scala
Supertypes
class Object
trait Matchable
class Any
Known subtypes
class Ok
class Tampered

Value members

Concrete methods

def applied()(using tx: Tx): List[Applied]

Attributes

Source
Migrator.scala
def apply(pending: List[(Int, String, List[String])])(using tx: Tx): Unit

Applies a batch. The transaction is the caller's: DESIGN §8.13 — this used to save and restore autocommit, commit and roll back for itself, which is exactly the work transact does.

Applies a batch. The transaction is the caller's: DESIGN §8.13 — this used to save and restore autocommit, commit and roll back for itself, which is exactly the work transact does.

Attributes

Source
Migrator.scala
def ensureLedger()(using tx: Tx): Unit

Attributes

Source
Migrator.scala
def status(dbDir: Path = ...)(using tx: Tx): Status

Verifies every on-disk migration, and checks applied ones still match the ledger.

Verifies every on-disk migration, and checks applied ones still match the ledger.

Attributes

Source
Migrator.scala