kotlinmicronaut

Cannot have configuration property 'datasources.default.schema-generate' if flyway migration is enabled


I got an error while updating micronaut from 3.4.3 to latest version 3.10.1. According to the micronaut-flyway documentation, I don't see any problem: https://micronaut-projects.github.io/micronaut-flyway/latest/guide/index.html

Caused by: io.micronaut.context.exceptions.ConfigurationException: Cannot have configuration property 'datasources.default.schema-generate' if flyway migration is enabled

Application.yml

datasources:
  default:
    url: "url"
    driverClassName: com.mysql.cj.jdbc.Driver
    username: "username"
    password: "password"
    schema-generate: CREATE_DROP
    dialect: MYSQL
flyway:
  datasources:
    default:
      enabled: true

Solution

  • Well, either you apply your DDL using Flyway or it is done by your ORM. But both does not work out very well.