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
77dbe999
Commit
77dbe999
authored
Mar 10, 2020
by
Andy Wilkinson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Polish "Add clearChecksums to Liquibase auto-configuration"
See gh-20417
parent
a2680efa
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
14 additions
and
14 deletions
+14
-14
LiquibaseAutoConfiguration.java
...t/autoconfigure/liquibase/LiquibaseAutoConfiguration.java
+1
-1
LiquibaseProperties.java
...ork/boot/autoconfigure/liquibase/LiquibaseProperties.java
+10
-10
LiquibaseAutoConfigurationTests.java
...oconfigure/liquibase/LiquibaseAutoConfigurationTests.java
+3
-3
No files found.
spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/liquibase/LiquibaseAutoConfiguration.java
View file @
77dbe999
...
@@ -101,6 +101,7 @@ public class LiquibaseAutoConfiguration {
...
@@ -101,6 +101,7 @@ public class LiquibaseAutoConfiguration {
SpringLiquibase
liquibase
=
createSpringLiquibase
(
liquibaseDataSource
.
getIfAvailable
(),
SpringLiquibase
liquibase
=
createSpringLiquibase
(
liquibaseDataSource
.
getIfAvailable
(),
dataSource
.
getIfUnique
(),
dataSourceProperties
);
dataSource
.
getIfUnique
(),
dataSourceProperties
);
liquibase
.
setChangeLog
(
this
.
properties
.
getChangeLog
());
liquibase
.
setChangeLog
(
this
.
properties
.
getChangeLog
());
liquibase
.
setClearCheckSums
(
this
.
properties
.
isClearChecksums
());
liquibase
.
setContexts
(
this
.
properties
.
getContexts
());
liquibase
.
setContexts
(
this
.
properties
.
getContexts
());
liquibase
.
setDefaultSchema
(
this
.
properties
.
getDefaultSchema
());
liquibase
.
setDefaultSchema
(
this
.
properties
.
getDefaultSchema
());
liquibase
.
setLiquibaseSchema
(
this
.
properties
.
getLiquibaseSchema
());
liquibase
.
setLiquibaseSchema
(
this
.
properties
.
getLiquibaseSchema
());
...
@@ -108,7 +109,6 @@ public class LiquibaseAutoConfiguration {
...
@@ -108,7 +109,6 @@ public class LiquibaseAutoConfiguration {
liquibase
.
setDatabaseChangeLogTable
(
this
.
properties
.
getDatabaseChangeLogTable
());
liquibase
.
setDatabaseChangeLogTable
(
this
.
properties
.
getDatabaseChangeLogTable
());
liquibase
.
setDatabaseChangeLogLockTable
(
this
.
properties
.
getDatabaseChangeLogLockTable
());
liquibase
.
setDatabaseChangeLogLockTable
(
this
.
properties
.
getDatabaseChangeLogLockTable
());
liquibase
.
setDropFirst
(
this
.
properties
.
isDropFirst
());
liquibase
.
setDropFirst
(
this
.
properties
.
isDropFirst
());
liquibase
.
setClearCheckSums
(
this
.
properties
.
isClearCheckSums
());
liquibase
.
setShouldRun
(
this
.
properties
.
isEnabled
());
liquibase
.
setShouldRun
(
this
.
properties
.
isEnabled
());
liquibase
.
setLabels
(
this
.
properties
.
getLabels
());
liquibase
.
setLabels
(
this
.
properties
.
getLabels
());
liquibase
.
setChangeLogParameters
(
this
.
properties
.
getParameters
());
liquibase
.
setChangeLogParameters
(
this
.
properties
.
getParameters
());
...
...
spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/liquibase/LiquibaseProperties.java
View file @
77dbe999
...
@@ -40,6 +40,12 @@ public class LiquibaseProperties {
...
@@ -40,6 +40,12 @@ public class LiquibaseProperties {
*/
*/
private
String
changeLog
=
"classpath:/db/changelog/db.changelog-master.yaml"
;
private
String
changeLog
=
"classpath:/db/changelog/db.changelog-master.yaml"
;
/**
* Whether to clear all checksums in the current changelog, so they will be
* recalculated upon the next update.
*/
private
boolean
clearChecksums
;
/**
/**
* Comma-separated list of runtime contexts to use.
* Comma-separated list of runtime contexts to use.
*/
*/
...
@@ -75,12 +81,6 @@ public class LiquibaseProperties {
...
@@ -75,12 +81,6 @@ public class LiquibaseProperties {
*/
*/
private
boolean
dropFirst
;
private
boolean
dropFirst
;
/**
* Whether to clear all checksums in the current changelog, so they will be
* recalculated next update.
*/
private
boolean
clearCheckSums
;
/**
/**
* Whether to enable Liquibase support.
* Whether to enable Liquibase support.
*/
*/
...
@@ -194,12 +194,12 @@ public class LiquibaseProperties {
...
@@ -194,12 +194,12 @@ public class LiquibaseProperties {
this
.
dropFirst
=
dropFirst
;
this
.
dropFirst
=
dropFirst
;
}
}
public
boolean
isClearCheck
S
ums
()
{
public
boolean
isClearCheck
s
ums
()
{
return
this
.
clearCheck
S
ums
;
return
this
.
clearCheck
s
ums
;
}
}
public
void
setClearCheck
Sums
(
boolean
clearCheckS
ums
)
{
public
void
setClearCheck
sums
(
boolean
clearChecks
ums
)
{
this
.
clearCheck
Sums
=
clearCheckS
ums
;
this
.
clearCheck
sums
=
clearChecks
ums
;
}
}
public
boolean
isEnabled
()
{
public
boolean
isEnabled
()
{
...
...
spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/liquibase/LiquibaseAutoConfigurationTests.java
View file @
77dbe999
...
@@ -145,7 +145,7 @@ class LiquibaseAutoConfigurationTests {
...
@@ -145,7 +145,7 @@ class LiquibaseAutoConfigurationTests {
assertThat
(
liquibase
.
getDatabaseChangeLogLockTable
())
assertThat
(
liquibase
.
getDatabaseChangeLogLockTable
())
.
isEqualTo
(
properties
.
getDatabaseChangeLogLockTable
());
.
isEqualTo
(
properties
.
getDatabaseChangeLogLockTable
());
assertThat
(
liquibase
.
isDropFirst
()).
isEqualTo
(
properties
.
isDropFirst
());
assertThat
(
liquibase
.
isDropFirst
()).
isEqualTo
(
properties
.
isDropFirst
());
assertThat
(
liquibase
.
isClearCheckSums
()).
isEqualTo
(
properties
.
isClearCheck
S
ums
());
assertThat
(
liquibase
.
isClearCheckSums
()).
isEqualTo
(
properties
.
isClearCheck
s
ums
());
assertThat
(
liquibase
.
isTestRollbackOnUpdate
()).
isEqualTo
(
properties
.
isTestRollbackOnUpdate
());
assertThat
(
liquibase
.
isTestRollbackOnUpdate
()).
isEqualTo
(
properties
.
isTestRollbackOnUpdate
());
}));
}));
}
}
...
@@ -193,9 +193,9 @@ class LiquibaseAutoConfigurationTests {
...
@@ -193,9 +193,9 @@ class LiquibaseAutoConfigurationTests {
}
}
@Test
@Test
void
overrideClearCheck
S
ums
()
{
void
overrideClearCheck
s
ums
()
{
this
.
contextRunner
.
withUserConfiguration
(
EmbeddedDataSourceConfiguration
.
class
)
this
.
contextRunner
.
withUserConfiguration
(
EmbeddedDataSourceConfiguration
.
class
)
.
withPropertyValues
(
"spring.liquibase.clear-check
-
sums:true"
)
.
withPropertyValues
(
"spring.liquibase.clear-checksums:true"
)
.
run
(
assertLiquibase
((
liquibase
)
->
assertThat
(
liquibase
.
isClearCheckSums
()).
isTrue
()));
.
run
(
assertLiquibase
((
liquibase
)
->
assertThat
(
liquibase
.
isClearCheckSums
()).
isTrue
()));
}
}
...
...
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