From 866a9b19d82547287053aa982ca702eb48e93afc Mon Sep 17 00:00:00 2001 From: Infendro Date: Thu, 2 Oct 2025 10:57:33 +0200 Subject: [PATCH] add README --- README.md | 44 +++++++++++++++++++ .../migration/{Plugin.kt => Migration.kt} | 0 2 files changed, 44 insertions(+) create mode 100644 README.md rename src/main/kotlin/com/infendro/migration/{Plugin.kt => Migration.kt} (100%) diff --git a/README.md b/README.md new file mode 100644 index 0000000..5cd1df3 --- /dev/null +++ b/README.md @@ -0,0 +1,44 @@ +# Kotlin Database Migration + +This library enables code-based database migrations in Kotlin. + +## Installation + +Add the following to your `build.gradle.kts`. + +```kotlin +repositories { + maven("https://git.infendro.com/api/packages/Infendro/maven") +} + +dependencies { + implementation("com.infendro:migration:1.0.0") +} +``` + +## Usage + +```kotlin +fun configureDatabase() { + // connect to a database + Database.connect( + url = , + user = , + password = , + ) + + // declare and execute migrations + migrate { + // create a migration + migration("initial") { + // execute code to migrate the database + } + } +} +``` + +## How It Works + +* Each migration is 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. diff --git a/src/main/kotlin/com/infendro/migration/Plugin.kt b/src/main/kotlin/com/infendro/migration/Migration.kt similarity index 100% rename from src/main/kotlin/com/infendro/migration/Plugin.kt rename to src/main/kotlin/com/infendro/migration/Migration.kt