feat: Implement draft version of pagination with user tweet trigger

This commit is contained in:
Faruk AYDIN
2022-08-29 23:11:28 +03:00
parent 6271cedc25
commit 5ddb5ab6fa
8 changed files with 92 additions and 35 deletions

View File

@@ -8,6 +8,7 @@ class Execution extends Base {
id!: string;
flowId!: string;
testRun = false;
internalId!: string;
executionSteps: ExecutionStep[] = [];
static tableName = 'executions';
@@ -19,6 +20,7 @@ class Execution extends Base {
id: { type: 'string', format: 'uuid' },
flowId: { type: 'string', format: 'uuid' },
testRun: { type: 'boolean' },
internalId: { type: 'string' },
},
};

View File

@@ -49,6 +49,14 @@ class Flow extends Base {
},
});
async lastInternalId() {
const lastInternalIdFetched: any = await this.$relatedQuery(
'executions'
).max('internal_id');
return lastInternalIdFetched[0].max;
}
async $beforeUpdate(
opt: ModelOptions,
queryContext: QueryContext