guilhermedias / generator-java-service

Java backend service generator
11 stars 1 forks source link

Support flyway #23

Open gustavodomenico opened 7 years ago

gustavodomenico commented 7 years ago

In order to correctly support flyway migrations we should add the plugin:

plugins {
  id "org.flywaydb.flyway" version "4.2.0"
}

And then we can configure it:

flyway {
    user = System.getenv('DATABASE_USERNAME') ?: 'postgres'
    password = System.getenv('DATABASE_PASSWORD') ?: 'postgres'
    url = System.getenv('DATABASE_URL') ?: 'jdbc:postgresql://localhost:8092/phone-book-search'
    driver = 'org.postgresql.Driver'
    validateOnMigrate = false
}
willmenn commented 7 years ago

But this is to run Flyway migrations, it will run outside the application? By doing this our application won't be self contained. May be this is a question to make on the database generator.

willmenn commented 7 years ago

And if the user choose to go with this approach we can't add the flyway dependence on grade, that is already there by default right now.