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(AbstractDatabase oldDatabase, AbstractDatabase newDatabase, ISettings settings, Set<PgStatement> toRefresh) -
Method Summary
Modifier and TypeMethodDescriptionstatic Set<ActionContainer>resolve(AbstractDatabase oldDb, AbstractDatabase newDb, List<Map.Entry<PgStatement, PgStatement>> additionalDependenciesOldDb, List<Map.Entry<PgStatement, PgStatement>> additionalDependenciesNewDb, Set<PgStatement> toRefresh, List<DbObject> dbObjects, ISettings settings)
-
Constructor Details
-
DepcyResolver
public DepcyResolver(AbstractDatabase oldDatabase, AbstractDatabase newDatabase, ISettings settings, Set<PgStatement> toRefresh)
-
-
Method Details
-
resolve
public static Set<ActionContainer> resolve(AbstractDatabase oldDb, AbstractDatabase newDb, List<Map.Entry<PgStatement, PgStatement>> additionalDependenciesOldDb, List<Map.Entry<PgStatement, PgStatement>> additionalDependenciesNewDb, Set<PgStatement> toRefresh, List<DbObject> dbObjects, ISettings settings)
-