Execute diff with different schema name

Hello , i have a different schema name for each tenant, i want to use Maven liquibase plugin to execute the diff goal for each tenant
i write this in my pom.xml file
My question what are the maven goals that i should execute to do the diff ??

org.liquibase
liquibase-maven-plugin
4.0.0

					<execution>
						<id>firstDB</id>
						<phase>diff</phase>
						<configuration>
							<propertyFile>src/main/resources/liquibase/liquibase.properties</propertyFile>
						</configuration>
						<goals>
							<goal>diff
							</goal>
						</goals>
					</execution>

					<execution>
						<id>SecondDB</id>
						<phase>diff</phase>
						<configuration>
							<propertyFile>src/main/resources/liquibase/liquibase.properties</propertyFile>
						</configuration>
						<goals>
							<goal>diff
							</goal>
						</goals>
					</execution>



				</executions>
				<dependencies>
					<dependency>
						<groupId>org.liquibase.ext</groupId>
						<artifactId>liquibase-hibernate5</artifactId>
						<version>4.0.0</version>
					</dependency>
					<dependency>
						<groupId>javax.xml.bind</groupId>
						<artifactId>jaxb-api</artifactId>
						<version>2.1</version>
					</dependency>
					<dependency>
						<groupId>com.sun.xml.bind</groupId>
						<artifactId>jaxb-core</artifactId>
						<version>2.3.0</version>
					</dependency>
					<dependency>
						<groupId>org.hibernate.validator</groupId>
						<artifactId>hibernate-validator</artifactId>
						<version>6.1.5.Final</version>
					</dependency>
					<dependency>
						<groupId>javax.validation</groupId>
						<artifactId>validation-api</artifactId>
						<version>2.0.1.Final</version>
					</dependency>
				</dependencies>
			</plugin>

Hi @faiez777,

Here is a primer on how to configure maven to run liquibase.
To update your database (defined in the liquibase.properties file) typically run:
mvn liquibase:update

If you want to do this with multiple different sources (or schemas or tenants) then you may have to configure different maven profiles that point to separate liquibase.properties files. That’s just one possibility.

HTH

Ronak

1 Like