2025-12-13 00:49:46 +01:00
2025-08-20 08:28:58 +02:00
2025-12-13 00:49:46 +01:00
2025-08-20 08:27:55 +02:00
2025-12-13 00:49:46 +01:00
2025-08-20 08:27:55 +02:00
2025-08-20 08:27:55 +02:00
2025-08-20 08:30:49 +02:00
2025-10-03 11:44:09 +02:00
2025-12-13 00:49:46 +01:00

Ktor Plugin for Database Migration

This plugin enables code-based database migrations in Ktor using Kotlin Database Migration.

Features

  • Declare database migrations (identified by a unique name).
    • Migrations are executed in the order they are declared in.
  • Executed migrations are tracked in a database table and skipped on subsequent runs.

Installation

Add the following to your build.gradle.kts.

repositories {
    maven("https://git.infendro.com/api/packages/Infendro/maven")
}

dependencies {
    implementation("com.infendro:ktor-migration:1.1.0")
}

Usage

import com.infendro.ktor.migration.Migration
import io.ktor.server.application.*
import org.jetbrains.exposed.sql.Database

fun Application.configureDatabase() {
    // connect to a database
    Database.connect(/* parameters */)

    // install the plugin
    install(Migration) {
        // create a migration
        migration("initial") {
            // execute code to migrate the database
        }
    }
}
Description
No description provided
Readme 123 KiB
Languages
Kotlin 100%