Add support for vendor specific Flyway migration locations
This commit adds support for using `{vendor}` placeholder in
`flyway.locations` configuration property value.
See gh-6900
This commit is contained in:
committed by
Stephane Nicoll
parent
62bff1017e
commit
65c2d1f5e7
@@ -234,6 +234,18 @@ public class FlywayAutoConfigurationTests {
|
||||
.isEqualTo(MigrationVersion.fromVersion("1"));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void useVendorDirectory() throws Exception {
|
||||
EnvironmentTestUtils.addEnvironment(this.context,
|
||||
"flyway.locations:classpath:db/vendors/{vendor}");
|
||||
registerAndRefresh(EmbeddedDataSourceConfiguration.class,
|
||||
FlywayAutoConfiguration.class,
|
||||
PropertyPlaceholderAutoConfiguration.class);
|
||||
Flyway flyway = this.context.getBean(Flyway.class);
|
||||
assertThat(flyway.getLocations()).containsExactly(
|
||||
"classpath:db/vendors/h2");
|
||||
}
|
||||
|
||||
private void registerAndRefresh(Class<?>... annotatedClasses) {
|
||||
this.context.register(annotatedClasses);
|
||||
this.context.refresh();
|
||||
|
||||
0
spring-boot-autoconfigure/src/test/resources/db/vendors/h2/V1__init.sql
vendored
Normal file
0
spring-boot-autoconfigure/src/test/resources/db/vendors/h2/V1__init.sql
vendored
Normal file
Reference in New Issue
Block a user