Kotlin: Database Migration – Harmonica 0.0.4


I tried to create Kotlin database migration library.

I released version 0.0.4 at GitHub. It is not fully developed yet.

You can find it also at Gradle Plugin page.

How to use

build.gradle

It requires JDBC driver, and kotlin-script-util library.

If you use PostgreSQL …

Directory Structure and Configuration File

It requires src/main/kotlin/db and its subdirectories, config and migration. It will be able to be changed in later release.

Directory Structure

And it needs DB configuration.

It must not include package description, because it is executed as Kotlin script.

Create Migration

Execute harmonicaCreate task.

If you specify migration name, execute as follows.

Then, migration file will be created into the migration directory.

Sample Migration

Migrate