Skip to content

Commit

Permalink
Correct datasource configuration #141
Browse files Browse the repository at this point in the history
  • Loading branch information
puneetbehl committed Aug 17, 2018
1 parent 8dd2524 commit a3d1a78
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/docs/asciidoc/configuration.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,9 @@ NOTE: All of the above configs can be used for a multiple datasources
If a reports dataSource is configured in application.yml
[source,groovy]
----
dataSources:
dataSource:
dataSource:
...
dataSources:
reports:
url: ...
driverClassName: ...
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,11 @@ trait DatabaseMigrationCommand {

Map<String, String> getDataSourceConfig(ConfigMap config = this.config) {
def dataSourceName = dataSource ?: 'dataSource'

if (dataSourceName == 'dataSource') {
return (Map<String, String>)(config.getProperty(dataSourceName, Map) ?: [:])
}

def dataSources = config.getProperty('dataSources', Map) ?: [:]
if (!dataSources) {
def defaultDataSource = config.getProperty('dataSource', Map)
Expand Down

0 comments on commit a3d1a78

Please sign in to comment.