Skip to content
This repository was archived by the owner on Mar 13, 2025. It is now read-only.

Commit ff35d87

Browse files
authored
Merge pull request #966 from grails/issue965
Remove "dataSource_" from bean name as dataSourceName of GroovyChange when using additional dataSources
2 parents b39e53a + 76e17c1 commit ff35d87

File tree

1 file changed

+3
-0
lines changed
  • grails-database-migration/src/main/groovy/org/grails/plugins/databasemigration/liquibase

1 file changed

+3
-0
lines changed

grails-database-migration/src/main/groovy/org/grails/plugins/databasemigration/liquibase/GroovyChange.groovy

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,9 @@ class GroovyChange extends AbstractChange {
9090
void load(ParsedNode parsedNode, ResourceAccessor resourceAccessor) throws ParsedNodeException {
9191
ctx = parsedNode.getChildValue(null, 'applicationContext', ApplicationContext)
9292
dataSourceName = parsedNode.getChildValue(null, DATA_SOURCE_NAME_KEY, String)
93+
if (dataSourceName?.startsWith("dataSource_")) {
94+
dataSourceName = dataSourceName.substring("dataSource_".length())
95+
}
9396

9497
initClosure = parsedNode.getChildValue(null, 'init', Closure)
9598
initClosure?.setResolveStrategy(Closure.DELEGATE_FIRST)

0 commit comments

Comments
 (0)