1 | initial version |
The relative path for Flyway in a Gradle project can be specified in the build.gradle file using the following steps:
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath "org.flywaydb:flyway-gradle-plugin:${flywayVersion}"
}
}
apply plugin: "org.flywaydb.flyway"
flyway {
url = "jdbc:postgresql://localhost:5432/mydb"
user = "myuser"
password = "mypass"
locations = ["filesystem:./db/migrations"]
}
In this example, the locations
property specifies that the migration scripts are located in the db/migrations
directory relative to the project root. This can be customized to point to a different directory using a relative path.