[英]MultiTenantSpringLiquibase Example.
I have an application with Multi Tenant.我有一个多租户应用程序。 However, this same application has liquibase.
然而,这个相同的应用程序有 liquibase。 I need to run liquibase in all my datasources however, I can not use this Bean.
我需要在我所有的数据源中运行 liquibase 但是,我不能使用这个 Bean。
My application.yml我的应用程序.yml
My bean:我的豆子:
@Bean
public MultiTenantSpringLiquibase liquibase(){
MultiTenantSpringLiquibase mt = new MultiTenantSpringLiquibase();
return mt;
}
I do not know how to instantiate this bean, since the documentation does not make clear how to do.我不知道如何实例化这个 bean,因为文档没有说明如何做。
http://www.liquibase.org/javadoc/liquibase/integration/spring/MultiTenantSpringLiquibase.html#setResourceLoader(org.springframework.core.io.ResourceLoader) http://www.liquibase.org/javadoc/liquibase/integration/spring/MultiTenantSpringLiquibase.html#setResourceLoader(org.springframework.core.io.ResourceLoader)
I also do not know how to set my application.yml and pass the tenants tree.我也不知道如何设置我的 application.yml 并传递租户树。
Could you help me?你可以帮帮我吗?
I had similar issue, so I removed the liquibase aspect from my main project and created a separate spring boot application which mainly handles liquibase aspect and creates schemas.我有类似的问题,所以我从我的主项目中删除了 liquibase 方面,并创建了一个单独的 Spring Boot 应用程序,主要处理 liquibase 方面并创建模式。 This Guy did a job well, take a look https://github.com/rmsantana/poc-multi-tenant/blob/master/src/main/java/com/rafael/Application.java
这家伙做得很好,看看https://github.com/rmsantana/poc-multi-tenant/blob/master/src/main/java/com/rafael/Application.java
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.