I want to use flywaydb in Kotlin but I have an error in use
My database is PostgreSQL and my ORM is Kotlin Exposed
Code:
val url = "jdbc:postgresql://127.0.0.1/test1"
Database.connect(url, driver = "org.postgresql.Driver", user = "postgres", password = "123")
var flyway = Flyway()
flyway.setDataSource(url, "postgres", "123")
flyway.migrate()
Error:
Exception in thread "main" org.flywaydb.core.api.FlywayException: Found non-empty schema(s) "public" without schema history table! Use baseline() or set baselineOnMigrate to true to initialize the schema history table. at org.flywaydb.core.Flyway$1.execute(Flyway.java:1197) at org.flywaydb.core.Flyway$1.execute(Flyway.java:1168) at org.flywaydb.core.Flyway.execute(Flyway.java:1655) at org.flywaydb.core.Flyway.migrate(Flyway.java:1168)
How can I solve it? Where is my code wrong?