postgres analyser fixed - broken loading FKs in incremental analysis

This commit is contained in:
Jan Prochazka
2025-11-28 10:24:53 +01:00
parent 0913011120
commit 65d13189b3
5 changed files with 104 additions and 44 deletions

View File

@@ -299,6 +299,23 @@ export class DatabaseAnalyser<TClient = any> {
}
}
objectIdConditionApplied(typeFields) {
if (!this.modifications || !typeFields || this.modifications.length == 0) {
return false;
}
if (this.modifications.some(x => typeFields.includes(x.objectTypeField) && x.action == 'all')) {
// do not filter objects
return false;
}
const filterIds = this.modifications
.filter(x => typeFields.includes(x.objectTypeField) && (x.action == 'add' || x.action == 'change'))
.map(x => x.objectId);
if (filterIds.length == 0) {
return false;
}
return true;
}
async getModifications() {
const snapshot = await this._getFastSnapshot();
if (!snapshot) return null;