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
008aef61
Commit
008aef61
authored
Feb 07, 2017
by
Stephane Nicoll
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Document @LiquibaseDataSource feature
Closes gh-8214
parent
21e86653
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
3 deletions
+10
-3
LiquibaseAutoConfiguration.java
...t/autoconfigure/liquibase/LiquibaseAutoConfiguration.java
+4
-3
howto.adoc
spring-boot-docs/src/main/asciidoc/howto.adoc
+6
-0
No files found.
spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/liquibase/LiquibaseAutoConfiguration.java
View file @
008aef61
/*
/*
* Copyright 2012-201
6
the original author or authors.
* Copyright 2012-201
7
the original author or authors.
*
*
* Licensed under the Apache License, Version 2.0 (the "License");
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* you may not use this file except in compliance with the License.
...
@@ -76,11 +76,12 @@ public class LiquibaseAutoConfiguration {
...
@@ -76,11 +76,12 @@ public class LiquibaseAutoConfiguration {
private
final
DataSource
liquibaseDataSource
;
private
final
DataSource
liquibaseDataSource
;
public
LiquibaseConfiguration
(
LiquibaseProperties
properties
,
public
LiquibaseConfiguration
(
LiquibaseProperties
properties
,
ResourceLoader
resourceLoader
,
DataSource
dataSource
,
ResourceLoader
resourceLoader
,
ObjectProvider
<
DataSource
>
dataSourceProvider
,
@LiquibaseDataSource
ObjectProvider
<
DataSource
>
liquibaseDataSourceProvider
)
{
@LiquibaseDataSource
ObjectProvider
<
DataSource
>
liquibaseDataSourceProvider
)
{
this
.
properties
=
properties
;
this
.
properties
=
properties
;
this
.
resourceLoader
=
resourceLoader
;
this
.
resourceLoader
=
resourceLoader
;
this
.
dataSource
=
dataSource
;
this
.
dataSource
=
dataSource
Provider
.
getIfUnique
()
;
this
.
liquibaseDataSource
=
liquibaseDataSourceProvider
.
getIfAvailable
();
this
.
liquibaseDataSource
=
liquibaseDataSourceProvider
.
getIfAvailable
();
}
}
...
...
spring-boot-docs/src/main/asciidoc/howto.adoc
View file @
008aef61
...
@@ -2210,6 +2210,12 @@ The master change log is by default read from `db/changelog/db.changelog-master.
...
@@ -2210,6 +2210,12 @@ The master change log is by default read from `db/changelog/db.changelog-master.
can be set using `liquibase.change-log`. In addition to YAML, Liquibase also supports
can be set using `liquibase.change-log`. In addition to YAML, Liquibase also supports
JSON, XML, and SQL change log formats.
JSON, XML, and SQL change log formats.
By default Liquibase will autowire the (`@Primary`) `DataSource` in your context and use
that for migrations. If you like to use a different `DataSource` you can create one and
mark its `@Bean` as `@LiquibaseDataSource` - if you do that remember to create another one
and mark it as `@Primary` if you want two data sources. Or you can use Liquibase's native
`DataSource` by setting `liquibase.[url,user,password]` in external properties.
See
See
{sc-spring-boot-autoconfigure}/liquibase/LiquibaseProperties.{sc-ext}[`LiquibaseProperties`]
{sc-spring-boot-autoconfigure}/liquibase/LiquibaseProperties.{sc-ext}[`LiquibaseProperties`]
for details of available settings like contexts, default schema etc.
for details of available settings like contexts, default schema etc.
...
...
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