We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
LiquibaseConfiguration multi database not update
I have multi database in a project,so i init multi SpringLiquibase.
SpringLiquibase(baseLiquibase) Bean init first SpringLiquibase(codegenLiquibase) Bean init second
base database has no any update(or it has update) codegen database has some update
then I debug the springboot application, codegen database not update.
after that,i delete the baseLiquibase Bean
then I debug again.
the codegen database updated.
`package com.pig4cloud.pigx.db;
import com.baomidou.dynamic.datasource.provider.DynamicDataSourceProvider; import liquibase.integration.spring.SpringLiquibase; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.DependsOn; import org.springframework.core.io.DefaultResourceLoader;
import javax.sql.DataSource; import java.util.List;
@configuration public class LiquibaseConfiguration {
@Autowired private List<DynamicDataSourceProvider> providers; @Bean public SpringLiquibase baseLiquibase() { return buildLiquibase("base"); } @Bean @DependsOn("baseLiquibase") public SpringLiquibase codegenLiquibase() { return buildLiquibase("codegen"); } private SpringLiquibase buildLiquibase(String module) { DataSource dataSource = providers.get(0).loadDataSources().get(module); SpringLiquibase liquibase = new SpringLiquibase(); // 模块Liquibase文件路径 liquibase.setChangeLog("classpath:liquibase/" + module + "/db.changelog.xml"); liquibase.setDataSource(dataSource); liquibase.setShouldRun(true); liquibase.setResourceLoader(new DefaultResourceLoader()); // 覆盖Liquibase changelog表名 liquibase.setDatabaseChangeLogTable(module + "_changelog_table"); liquibase.setDatabaseChangeLogLockTable(module + "_changelog_lock_table"); return liquibase; }
}`
mutli SpringLiquibase @bean can run normal.
4.23.0
MySql 8.x
spring boot
No response
windows 11
The text was updated successfully, but these errors were encountered:
2023-07-19 23:23:57.906 INFO 32312 --- [ main] liquibase.util : UPDATE SUMMARY 2023-07-19 23:23:57.906 INFO 32312 --- [ main] liquibase.util : Run: 7 2023-07-19 23:23:57.906 INFO 32312 --- [ main] liquibase.util : Previously run: 0 2023-07-19 23:23:57.906 INFO 32312 --- [ main] liquibase.util : Filtered out: 0 2023-07-19 23:23:57.906 INFO 32312 --- [ main] liquibase.util : ------------------------------- 2023-07-19 23:23:57.906 INFO 32312 --- [ main] liquibase.util : Total change sets: 7
Total change sets: 7
2023-07-19 23:23:57.906 INFO 32312 --- [ main] liquibase.util : Update summary generated 2023-07-19 23:23:57.906 DEBUG 32312 --- [ main] liquibase.executor : Release Database Lock 2023-07-19 23:23:57.911 DEBUG 32312 --- [ main] liquibase.executor : Changelog query completed. 2023-07-19 23:23:57.915 INFO 32312 --- [ main] liquibase.lockservice : Successfully released change log lock 2023-07-19 23:23:57.916 DEBUG 32312 --- [ main] liquibase.servicelocator : Loaded liquibase.lockservice.LockService instance liquibase.lockservice.LockServiceImpl 2023-07-19 23:23:57.916 DEBUG 32312 --- [ main] liquibase.servicelocator : Loaded liquibase.lockservice.LockService instance liquibase.lockservice.MockLockService 2023-07-19 23:23:57.916 DEBUG 32312 --- [ main] liquibase.servicelocator : Loaded liquibase.lockservice.LockService instance liquibase.lockservice.OfflineLockService 2023-07-19 23:23:57.916 DEBUG 32312 --- [ main] liquibase.servicelocator : Loaded liquibase.lockservice.LockService instance liquibase.lockservice.StandardLockService 2023-07-19 23:23:57.919 DEBUG 32312 --- [ main] liquibase.executor : Release Database Lock 2023-07-19 23:23:57.922 DEBUG 32312 --- [ main] liquibase.executor : Changelog query completed. 2023-07-19 23:23:57.924 INFO 32312 --- [ main] liquibase.lockservice : Successfully released change log lock
Sorry, something went wrong.
No branches or pull requests
Search first
Description
LiquibaseConfiguration multi database not update
I have multi database in a project,so i init multi SpringLiquibase.
SpringLiquibase(baseLiquibase) Bean init first
SpringLiquibase(codegenLiquibase) Bean init second
base database has no any update(or it has update)
codegen database has some update
then I debug the springboot application, codegen database not update.
after that,i delete the baseLiquibase Bean
then I debug again.
the codegen database updated.
Steps To Reproduce
`package com.pig4cloud.pigx.db;
import com.baomidou.dynamic.datasource.provider.DynamicDataSourceProvider;
import liquibase.integration.spring.SpringLiquibase;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.DependsOn;
import org.springframework.core.io.DefaultResourceLoader;
import javax.sql.DataSource;
import java.util.List;
@configuration
public class LiquibaseConfiguration {
}`
Expected/Desired Behavior
mutli SpringLiquibase @bean can run normal.
Liquibase Version
4.23.0
Database Vendor & Version
MySql 8.x
Liquibase Integration
spring boot
Liquibase Extensions
No response
OS and/or Infrastructure Type/Provider
windows 11
Additional Context
No response
Are you willing to submit a PR?
The text was updated successfully, but these errors were encountered: