plugins {
id "org.flywaydb.flyway" version "4.2.0"
}
| Name | Description |
|---|---|
| flywayMigrate | Migrates the database |
| flywayClean | Drops all objects in the configured schemas |
| flywayInfo | Prints the details and status information about all the migrations |
| flywayValidate | Validates the applied migrations against the ones available on the classpath |
| flywayBaseline | Baselines an existing database, excluding all migrations up to and including baselineVersion |
| flywayRepair | Repairs the metadata table |
The Flyway Gradle plugin can be configured in the following ways:
flyway {
url = 'jdbc:h2:mem:mydb'
user = 'myUsr'
password = 'mySecretPwd'
schemas = ['schema1', 'schema2', 'schema3']
placeholders = [
'keyABC': 'valueXYZ',
'otherplaceholder': 'value123'
]
}
gradle -Pflyway.user=myUsr -Pflyway.schemas=schema1,schema2 -Pflyway.placeholders.keyABC=valXYZ
gradle.properties
flyway.user=myUser flyway.password=mySecretPwd # List are defined as comma-separated values flyway.schemas=schema1,schema2,schema3 # Individual placeholders are prefixed by flyway.placeholders. flyway.placeholders.keyABC=valueXYZ flyway.placeholders.otherplaceholder=value123
build.gradle
project.ext['flyway.user']='myUsr' project.ext['flyway.password']='mySecretPwd' project.ext['flyway.schemas']='schema1,schema2,schema3' project.ext['flyway.placeholders.keyABC']='valueXYZ' project.ext['flyway.placeholders.otherplaceholder']='value123'
gradle -Dflyway.user=myUsr -Dflyway.schemas=schema1,schema2 -Dflyway.placeholders.keyABC=valXYZ
System properties override Gradle properties override Plugin configuration