Class DiffTree
java.lang.Object
org.pgcodekeeper.core.model.difftree.DiffTree
Utility class for creating and managing diff trees that represent
differences between database schemas.
-
Method Summary
Modifier and TypeMethodDescriptionstatic voidaddColumns(Collection<IColumn> left, Collection<IColumn> right, TreeElement parent, List<TreeElement> list) Deprecated.this method is deprecatedstatic TreeElementCreates a diff tree comparing two database schemas.static TreeElementCreates a diff tree comparing two database schemas with progress monitoring.createTree(IDatabase left, IDatabase right) Creates a diff tree by comparing two database schemas and building a hierarchical tree structure representing the differences between them.static Set<TreeElement>getTablesWithChangedColumns(IDatabase oldDbFull, IDatabase newDbFull, List<TreeElement> selected) Gets tables that have changed columns from the selected elements.
-
Method Details
-
create
public static TreeElement create(ISettings settings, IDatabase left, IDatabase right) throws InterruptedException Creates a diff tree comparing two database schemas.- Parameters:
settings- the compare settingsleft- the left (old) database schemaright- the right (new) database schema- Returns:
- the root TreeElement representing the diff tree
- Throws:
InterruptedException- if the operation is interrupted
-
create
public static TreeElement create(ISettings settings, IDatabase left, IDatabase right, IMonitor monitor) throws InterruptedException Creates a diff tree comparing two database schemas with progress monitoring.- Parameters:
settings- the compare settingsleft- the left (old) database schemaright- the right (new) database schemamonitor- the progress monitor for tracking operation progress- Returns:
- the root TreeElement representing the diff tree
- Throws:
InterruptedException- if the operation is interrupted
-
addColumns
@Deprecated public static void addColumns(Collection<IColumn> left, Collection<IColumn> right, TreeElement parent, List<TreeElement> list) Deprecated.this method is deprecatedAdds column differences to the tree element list.- Parameters:
left- the left (old) column listright- the right (new) column listparent- the parent tree elementlist- the list to add column differences to
-
getTablesWithChangedColumns
public static Set<TreeElement> getTablesWithChangedColumns(IDatabase oldDbFull, IDatabase newDbFull, List<TreeElement> selected) Gets tables that have changed columns from the selected elements.- Parameters:
oldDbFull- the old database schemanewDbFull- the new database schemaselected- the list of selected tree elements- Returns:
- a set of table elements that have changed columns
-
createTree
Creates a diff tree by comparing two database schemas and building a hierarchical tree structure representing the differences between them.- Parameters:
left- the left (old) database schema to compareright- the right (new) database schema to compare- Returns:
- the root TreeElement representing the complete diff tree with "Database" as the root node and all schema differences as child nodes
- Throws:
InterruptedException- if the operation is cancelled via the progress monitor
-