Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in / Register
Toggle navigation
S
spring-boot
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
DEMO
spring-boot
Commits
44f50820
Commit
44f50820
authored
Jan 21, 2016
by
Stephane Nicoll
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch '1.2.x'
parents
e33221aa
58ebfdcb
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
19 additions
and
1 deletion
+19
-1
FlywayAutoConfiguration.java
...rk/boot/autoconfigure/flyway/FlywayAutoConfiguration.java
+4
-0
FlywayProperties.java
...framework/boot/autoconfigure/flyway/FlywayProperties.java
+2
-1
FlywayAutoConfigurationTests.java
...ot/autoconfigure/flyway/FlywayAutoConfigurationTests.java
+13
-0
No files found.
spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/flyway/FlywayAutoConfiguration.java
View file @
44f50820
...
@@ -58,6 +58,7 @@ import org.springframework.util.ObjectUtils;
...
@@ -58,6 +58,7 @@ import org.springframework.util.ObjectUtils;
* @author Phillip Webb
* @author Phillip Webb
* @author Vedran Pavic
* @author Vedran Pavic
* @author Stephane Nicoll
* @author Stephane Nicoll
* @author Jacques-Etienne Beaudet
* @since 1.1.0
* @since 1.1.0
*/
*/
@Configuration
@Configuration
...
@@ -132,6 +133,9 @@ public class FlywayAutoConfiguration {
...
@@ -132,6 +133,9 @@ public class FlywayAutoConfiguration {
else
{
else
{
flyway
.
setDataSource
(
this
.
dataSource
);
flyway
.
setDataSource
(
this
.
dataSource
);
}
}
// TODO: remove this line once SPR-13749 is fixed
flyway
.
setLocations
(
this
.
properties
.
getLocations
().
toArray
(
new
String
[
0
]));
return
flyway
;
return
flyway
;
}
}
...
...
spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/flyway/FlywayProperties.java
View file @
44f50820
...
@@ -16,6 +16,7 @@
...
@@ -16,6 +16,7 @@
package
org
.
springframework
.
boot
.
autoconfigure
.
flyway
;
package
org
.
springframework
.
boot
.
autoconfigure
.
flyway
;
import
java.util.ArrayList
;
import
java.util.Arrays
;
import
java.util.Arrays
;
import
java.util.Collections
;
import
java.util.Collections
;
import
java.util.List
;
import
java.util.List
;
...
@@ -39,7 +40,7 @@ public class FlywayProperties {
...
@@ -39,7 +40,7 @@ public class FlywayProperties {
/**
/**
* Locations of migrations scripts.
* Locations of migrations scripts.
*/
*/
private
List
<
String
>
locations
=
Arrays
.
asList
(
"db/migration"
);
private
List
<
String
>
locations
=
new
ArrayList
<
String
>(
Arrays
.
asList
(
"db/migration"
)
);
/**
/**
* Check that migration scripts location exists.
* Check that migration scripts location exists.
...
...
spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/flyway/FlywayAutoConfigurationTests.java
View file @
44f50820
...
@@ -130,6 +130,19 @@ public class FlywayAutoConfigurationTests {
...
@@ -130,6 +130,19 @@ public class FlywayAutoConfigurationTests {
Arrays
.
asList
(
flyway
.
getLocations
()).
toString
());
Arrays
.
asList
(
flyway
.
getLocations
()).
toString
());
}
}
@Test
public
void
overrideLocationsList
()
throws
Exception
{
EnvironmentTestUtils
.
addEnvironment
(
this
.
context
,
"flyway.locations[0]:classpath:db/changelog"
,
"flyway.locations[1]:classpath:db/migration"
);
registerAndRefresh
(
EmbeddedDataSourceConfiguration
.
class
,
FlywayAutoConfiguration
.
class
,
PropertyPlaceholderAutoConfiguration
.
class
);
Flyway
flyway
=
this
.
context
.
getBean
(
Flyway
.
class
);
assertEquals
(
"[classpath:db/changelog, classpath:db/migration]"
,
Arrays
.
asList
(
flyway
.
getLocations
()).
toString
());
}
@Test
@Test
public
void
overrideSchemas
()
throws
Exception
{
public
void
overrideSchemas
()
throws
Exception
{
EnvironmentTestUtils
.
addEnvironment
(
this
.
context
,
"flyway.schemas:public"
);
EnvironmentTestUtils
.
addEnvironment
(
this
.
context
,
"flyway.schemas:public"
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment