Applies to
- Liquibase Pro
- Liquibase Open Source (Community)
Question
Can you restrict which objects are used in the diff command in Liquibase?
Answer
Yes, you can restrict which database objects are included in the diff command by using the diffTypes parameter. This parameter allows you to specify the types of objects to include when comparing two database schemas.
The diffTypes parameter accepts a comma-separated list of object types, such as tables, views, columns, indexes, sequences, and more. By specifying this parameter, you can focus on the specific types of objects you want to compare and exclude others.
Example Usage
To restrict the comparison to only tables and views, you can run the diff command like this:
liquibase diff --referenceUrl=jdbc:postgresql://localhost:5432/db1 --url=jdbc:postgresql://localhost:5432/db2 --diffTypes=tables,views
If the diffTypes parameter is not set, the default types used are columns, foreignkeys, indexes, primarykeys, tables,
uniqueconstraints, views
.
The full list of accepted types are: catalogs, checkconstraints, columns, data, databasepackage, databasepackagebody, foreignkeys, functions, indexes, primarykeys, sequences, storedprocedures, tables, triggers, uniqueconstraints, views
.
Comments
0 comments
Article is closed for comments.