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

fix grails/gorm-hibernate5#973 for grails-7 (9.0.x) #985

Merged
merged 1 commit into from
Feb 20, 2025

Conversation

zyro23
Copy link
Contributor

@zyro23 zyro23 commented Feb 20, 2025

this is a port of grails/grails-database-migration#164 fixing #973 for grails-7 (gorm-hibernate5 9.0.x / database-migration 9.0.0-SNAPSHOT).

i created a sample app to reproduce the issue on grails-7 (blank start.grails.org grails-7.0.0-M1 app, locally built/published org.grails.plugins:database-migration:9.0.0-SNAPSHOT):
zyro23/gorm-hibernate5-973@79475d0

prior to the changes, running ./grailsw dbm-gorm-diff --dataSource=second errors with:

$ ./grailsw dbm-gorm-diff --dataSource=second

> Task :dbmGormDiff

  .   ____          _            __ _ _
 /\\ / ___'_ __ _ _(_)_ __  __ _ \ \ \ \
( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \
 \\/  ___)| |_)| | | | | || (_| |  ) ) ) )
  '  |____| .__|_| |_|_| |_\__, | / / / /
 =========|_|==============|___/=/_/_/_/

 :: Spring Boot ::                (v3.4.1)

Grails application running at http://localhost:0 in environment: development
Error |
Command execution error: DataSource not found for name [dataSource_second] in configuration. Please check your multiple data sources configuration and try again.
<===========--> 85% EXECUTING [12s]
> :dbmGormDiff

FAILURE: Build failed with an exception.

for secondary dataSources, the sessionFactory lookup as well as the hibernateDatastore lookup are now made with the dataSource name without the dataSource_ prefix.

after applying the changes and re-building/-publishing locally the command succeeds:

$ ./grailsw dbm-gorm-diff --dataSource=second

> Task :dbmGormDiff

  .   ____          _            __ _ _
 /\\ / ___'_ __ _ _(_)_ __  __ _ \ \ \ \
( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \
 \\/  ___)| |_)| | | | | || (_| |  ) ) ) )
  '  |____| .__|_| |_|_| |_\__, | / / / /
 =========|_|==============|___/=/_/_/_/

 :: Spring Boot ::                (v3.4.1)

Grails application running at http://localhost:0 in environment: development
BEST PRACTICE: The changelog generated by diffChangeLog/generateChangeLog should be inspected for correctness and completeness before being deployed. Some database objects and their dependencies cannot be represented automatically, and they may need to be manually updated before being deployed.
databaseChangeLog = {
}

additional notes regarding the sample app (id say these are separate issues):

thanks & regards.

@CLAassistant
Copy link

CLAassistant commented Feb 20, 2025

CLA assistant check
All committers have signed the CLA.

@grails grails deleted a comment from CLAassistant Feb 20, 2025
@jdaugherty
Copy link
Contributor

Thank you @zyro23 .

Concerning the pinned version, we did not add liquibase to the bom until recently. This should be fixed in the next milestone so these type of excludes are unnecessary.

Concerning the commerical exclude, I'll get this fixed in another pull request.

Thank you for doing this work.

@jdaugherty jdaugherty merged commit f21ce79 into grails:9.0.x Feb 20, 2025
7 checks passed
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants