Schema

interface Schema

API for creating and migrating a SQL database.

Functions

create
Link copied to clipboard
common
abstract fun create(driver: SqlDriver)
Use driver to create the schema from scratch.
migrate
Link copied to clipboard
common
abstract fun migrate(driver: SqlDriver, oldVersion: Int, newVersion: Int)
Use driver to migrate from schema oldVersion to newVersion.

Properties

version
Link copied to clipboard
common
abstract val version: Int
The version of this schema.

Extensions

migrateWithCallbacks
Link copied to clipboard
common
fun SqlDriver.Schema.migrateWithCallbacks(driver: SqlDriver, oldVersion: Int, newVersion: Int, vararg callbacks: AfterVersion)
Run SqlDriver.Schema.migrate normally but execute callbacks during the migration whenever it finished upgrading to a version specified by AfterVersion.afterVersion.
fun SqlDriver.Schema.migrateWithCallbacks(driver: SqlDriver, oldVersion: Int, newVersion: Int, vararg callbacks: AfterVersionWithDriver)
Run SqlDriver.Schema.migrate normally but execute callbacks during the migration whenever it finished upgrading to a version specified by AfterVersion.afterVersion.