2022-10-21 03:29:25 -07:00
|
|
|
import type { WorkflowExecuteMode } from 'n8n-workflow';
|
|
|
|
import { Column, Entity, Index, PrimaryGeneratedColumn } from 'typeorm';
|
|
|
|
import { datetimeColumnType, jsonColumnType } from './AbstractEntity';
|
2022-11-09 06:25:00 -08:00
|
|
|
import type { IExecutionFlattedDb, IWorkflowDb } from '@/Interfaces';
|
2019-07-22 11:29:06 -07:00
|
|
|
|
|
|
|
@Entity()
|
2022-02-18 06:59:34 -08:00
|
|
|
@Index(['workflowId', 'id'])
|
|
|
|
@Index(['waitTill', 'id'])
|
|
|
|
@Index(['finished', 'id'])
|
|
|
|
@Index(['workflowId', 'finished', 'id'])
|
|
|
|
@Index(['workflowId', 'waitTill', 'id'])
|
2019-07-22 11:29:06 -07:00
|
|
|
export class ExecutionEntity implements IExecutionFlattedDb {
|
|
|
|
@PrimaryGeneratedColumn()
|
|
|
|
id: number;
|
|
|
|
|
|
|
|
@Column('text')
|
|
|
|
data: string;
|
|
|
|
|
|
|
|
@Column()
|
|
|
|
finished: boolean;
|
|
|
|
|
2019-12-21 13:04:47 -08:00
|
|
|
@Column('varchar')
|
2019-07-22 11:29:06 -07:00
|
|
|
mode: WorkflowExecuteMode;
|
|
|
|
|
|
|
|
@Column({ nullable: true })
|
|
|
|
retryOf: string;
|
|
|
|
|
|
|
|
@Column({ nullable: true })
|
|
|
|
retrySuccessId: string;
|
|
|
|
|
2022-10-21 03:29:25 -07:00
|
|
|
@Column(datetimeColumnType)
|
2019-07-22 11:29:06 -07:00
|
|
|
startedAt: Date;
|
|
|
|
|
2020-07-17 08:08:40 -07:00
|
|
|
@Index()
|
2022-10-21 03:29:25 -07:00
|
|
|
@Column({ type: datetimeColumnType, nullable: true })
|
2019-07-22 11:29:06 -07:00
|
|
|
stoppedAt: Date;
|
|
|
|
|
2022-10-21 03:29:25 -07:00
|
|
|
@Column(jsonColumnType)
|
2019-07-22 11:29:06 -07:00
|
|
|
workflowData: IWorkflowDb;
|
|
|
|
|
|
|
|
@Column({ nullable: true })
|
|
|
|
workflowId: string;
|
2021-08-21 05:11:32 -07:00
|
|
|
|
2022-10-21 03:29:25 -07:00
|
|
|
@Column({ type: datetimeColumnType, nullable: true })
|
2021-08-21 05:11:32 -07:00
|
|
|
waitTill: Date;
|
2019-07-22 11:29:06 -07:00
|
|
|
}
|