Files
migration.ktor/README.md
Infendro 3380f50cc7
All checks were successful
/ publish (push) Successful in 1m2s
update README
2025-12-13 23:11:46 +01:00

39 lines
773 B
Markdown

# migration-ktor
`migration-ktor` is a Kotlin library that enables code-based migrations in Ktor.
## Installation
Add the following to your `build.gradle.kts`.
```kotlin
repositories {
maven("https://git.infendro.com/api/packages/Infendro/maven")
}
dependencies {
implementation("com.infendro:ktor-migration:1.1.1")
}
```
## Usage
```kotlin
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
}
}
}
```