Ktor-Exposed database migration

157 views Asked by At

Question:

How to maintain database migration history using Exposed framework's SchemaUtils?

Background:

Recently, we have started evaluating API development using Ktor with Exposed. and noticed that exposed offers database migration feature built-in using SchemaUtils.

transaction(database) {
            SchemaUtils.create(Articles)
        }

I was able to find out the basic documentation from here but I could not find how answers to following?

  • How to execute migration for altering table structure?
  • How to manage migration history similar to other what RoR or liquibase does?
    • RoR manages migration history in database table for maintenance purpose
    • liquibase provides a similar feature

The only thing, I could confirm are the console logs by expose indicating which tables are created.

Additional Details:

  • Ktor version : 2.3.7
  • Kotlin version : 2.3.7
  • Exposed version : 0.45.0

Any guidance is much appreciated.

0

There are 0 answers