David
David

Reputation: 11

Flyway using subdirectories under sql directory with relative path

I am currently trying to specify a subdirectory under the sql directory and keep getting an error. Here is the command I am using:

flyway -url=jdbc:postgresql://localhost:5432/database -schemas=schema1 -locations=sql/schema1 migrate

I have tried prefixing with classpath: or filesystem: but was hoping to provide a relative directory so I can move the folder around without breaking the code.

WARNING: Unable to resolve location classpath:sql/schema1

Any thoughts?

Upvotes: 1

Views: 3160

Answers (1)

pards
pards

Reputation: 1166

You can use relative directory paths with the filesystem: prefix, as follows.

$ mvn flyway:migrate -Dflyway.locations=filesystem:scripts/migration

Upvotes: 1

Related Questions