You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am trying to use Spring Liquibase integration. Our API service is accessing multiple data sources according to HTTP request. When there is new database change(ex. add new column to table), we need to apply that change in all datasources.
It seems "MultiTenantSpringLiquibase" only works with database per tenant model only if jndi is specified with multiple datasources. In our case, all data sources are retrieved dynamically and liquibase has to apply the changes in all datasources.
Is there any way?
Below bean in used. We set dataSource explicitly null otherwise it uses schema per tenant model, We have database per tenant model. We don't want to statically specify jndi as we wanted to apply it dynamically.
@Bean
public MultiTenantSpringLiquibase liquibase(DataSource dataSource) {
MultiTenantSpringLiquibase multiTenantSpringLiquibase = new MultiTenantSpringLiquibase();
multiTenantSpringLiquibase.setDataSource(null);
multiTenantSpringLiquibase.setLiquibaseSchema("liquibase");
multiTenantSpringLiquibase.setChangeLog("classpath:db.changelog/service-changelog.yaml");
multiTenantSpringLiquibase.setShouldRun(true);
return multiTenantSpringLiquibase;
}
Steps To Reproduce
Inject above bean
Disable default auto configuration @SpringBootApplication(exclude={LiquibaseAutoConfiguration.class})
Use MultiClientDataSource class which is datasource given to liquibase bean. That datasource has multiple datasources(targetDataSources)
Expected/Desired Behavior
Find a way to extract multiple datasources instead of finding it from jndi
Liquibase Version
4.27.0
Database Vendor & Version
No response
Liquibase Integration
No response
Liquibase Extensions
No response
OS and/or Infrastructure Type/Provider
No response
Additional Context
No response
Are you willing to submit a PR?
I'm willing to submit a PR (Thank you!)
The text was updated successfully, but these errors were encountered:
Search first
Description
I am trying to use Spring Liquibase integration. Our API service is accessing multiple data sources according to HTTP request. When there is new database change(ex. add new column to table), we need to apply that change in all datasources.
It seems "MultiTenantSpringLiquibase" only works with database per tenant model only if jndi is specified with multiple datasources. In our case, all data sources are retrieved dynamically and liquibase has to apply the changes in all datasources.
Is there any way?
Below bean in used. We set dataSource explicitly null otherwise it uses schema per tenant model, We have database per tenant model. We don't want to statically specify jndi as we wanted to apply it dynamically.
Steps To Reproduce
Expected/Desired Behavior
Find a way to extract multiple datasources instead of finding it from jndi
Liquibase Version
4.27.0
Database Vendor & Version
No response
Liquibase Integration
No response
Liquibase Extensions
No response
OS and/or Infrastructure Type/Provider
No response
Additional Context
No response
Are you willing to submit a PR?
The text was updated successfully, but these errors were encountered: