Class DepcyResolver
Implementation notes:
General idea behind this class is graph passes that collect required actions. addDropStatements starts a bottom-to-top pass in the old DB graph, addCreateStatements starts a top-to-bottom pass in the new DB graph. When these passes reach an object requiring an ALTER, an "opposite direction" pass for that object is started. This also allows us to treat alters as "drops" here. Passes are eventually exhausted when all the actions have been collected into actions set.
At the very end recreateDrops is called, which starts a "create pass" for every object that was dropped but should not have been - i.e. it was a dependency related drop. These passes are performed until they stop generating new actions. This ensures that all dropped dependencies have been recreated, and any dependency drops that may have been generated in the process have also been accounted for.
-
Constructor Summary
ConstructorsConstructorDescriptionDepcyResolver(IDatabase oldDatabase, IDatabase newDatabase, DiffSettings diffSettings, Set<IStatement> toRefresh) -
Method Summary
Modifier and TypeMethodDescriptionstatic Set<ActionContainer>resolve(IDatabase oldDb, IDatabase newDb, List<Map.Entry<IStatement, IStatement>> additionalDependenciesOldDb, List<Map.Entry<IStatement, IStatement>> additionalDependenciesNewDb, Set<IStatement> toRefresh, List<DbObject> dbObjects, DiffSettings diffSettings)
-
Constructor Details
-
DepcyResolver
public DepcyResolver(IDatabase oldDatabase, IDatabase newDatabase, DiffSettings diffSettings, Set<IStatement> toRefresh)
-
-
Method Details
-
resolve
public static Set<ActionContainer> resolve(IDatabase oldDb, IDatabase newDb, List<Map.Entry<IStatement, IStatement>> additionalDependenciesOldDb, List<Map.Entry<IStatement, IStatement>> additionalDependenciesNewDb, Set<IStatement> toRefresh, List<DbObject> dbObjects, DiffSettings diffSettings)
-