🗃️ Add relevant indexes in execution_entity (#2794)

* 🗃️ Add relevant indexes in execution_entity

* CR suggestions
This commit is contained in:
Ahsan Virani
2022-02-18 15:59:34 +01:00
committed by GitHub
parent ce9cca82b1
commit 0a9ce092fc
7 changed files with 121 additions and 2 deletions

View File

@@ -23,6 +23,11 @@ function resolveDataType(dataType: string) {
}
@Entity()
@Index(['workflowId', 'id'])
@Index(['waitTill', 'id'])
@Index(['finished', 'id'])
@Index(['workflowId', 'finished', 'id'])
@Index(['workflowId', 'waitTill', 'id'])
export class ExecutionEntity implements IExecutionFlattedDb {
@PrimaryGeneratedColumn()
id: number;
@@ -52,11 +57,9 @@ export class ExecutionEntity implements IExecutionFlattedDb {
@Column(resolveDataType('json'))
workflowData: IWorkflowDb;
@Index()
@Column({ nullable: true })
workflowId: string;
@Index()
@Column({ type: resolveDataType('datetime') as ColumnOptions['type'], nullable: true })
waitTill: Date;
}