Use foreign key constraints
Signed-off-by: Damon Kaswell <damon.kaswell1@hp.com>
This commit is contained in:
committed by
Fredrik Adelöw
parent
25da47e68d
commit
b6d0c26902
@@ -111,6 +111,9 @@ exports.up = async function up(knex) {
|
||||
table
|
||||
.uuid('ingestion_id')
|
||||
.notNullable()
|
||||
.references('id')
|
||||
.inTable('ingestions')
|
||||
.onDelete('CASCADE')
|
||||
.comment('The id of the ingestion in which this mark took place');
|
||||
|
||||
table
|
||||
@@ -148,6 +151,9 @@ exports.up = async function up(knex) {
|
||||
table
|
||||
.uuid('ingestion_mark_id')
|
||||
.notNullable()
|
||||
.references('id')
|
||||
.inTable('ingestion_marks')
|
||||
.onDelete('CASCADE')
|
||||
.comment(
|
||||
'Every time a mark happens during an ingestion, there are a list of entities marked.',
|
||||
);
|
||||
|
||||
@@ -280,12 +280,24 @@ export class IncrementalIngestionEngine implements IterationEngine {
|
||||
},
|
||||
})) ?? [];
|
||||
|
||||
const removed: DeferredEntity[] = done
|
||||
? []
|
||||
: await this.manager.computeRemoved(
|
||||
this.options.provider.getProviderName(),
|
||||
id,
|
||||
);
|
||||
const removed: DeferredEntity[] = [];
|
||||
|
||||
let doComputeRemoved = false;
|
||||
|
||||
if (!done) {
|
||||
doComputeRemoved = true;
|
||||
} else {
|
||||
if (entities && entities.length > 0) {
|
||||
doComputeRemoved = true;
|
||||
}
|
||||
}
|
||||
|
||||
if(doComputeRemoved) {
|
||||
removed.push(...await this.manager.computeRemoved(
|
||||
this.options.provider.getProviderName(),
|
||||
id,
|
||||
));
|
||||
}
|
||||
|
||||
await this.options.connection.applyMutation({
|
||||
type: 'delta',
|
||||
|
||||
Reference in New Issue
Block a user