Based on https://github.com/n8n-io/n8n/pull/7065 --------- Co-authored-by: कारतोफ्फेलस्क्रिप्ट™ <aditya@netroy.in>
70 lines
1.5 KiB
TypeScript
70 lines
1.5 KiB
TypeScript
import { ExecutionStatus, WorkflowExecuteMode } from 'n8n-workflow';
|
|
import {
|
|
Column,
|
|
Entity,
|
|
Generated,
|
|
Index,
|
|
ManyToOne,
|
|
OneToMany,
|
|
OneToOne,
|
|
PrimaryColumn,
|
|
Relation,
|
|
} from 'typeorm';
|
|
import { datetimeColumnType } from './AbstractEntity';
|
|
import { idStringifier } from '../utils/transformers';
|
|
import type { ExecutionData } from './ExecutionData';
|
|
import type { ExecutionMetadata } from './ExecutionMetadata';
|
|
import { WorkflowEntity } from './WorkflowEntity';
|
|
|
|
@Entity()
|
|
@Index(['workflowId', 'id'])
|
|
@Index(['waitTill', 'id'])
|
|
@Index(['finished', 'id'])
|
|
@Index(['workflowId', 'finished', 'id'])
|
|
@Index(['workflowId', 'waitTill', 'id'])
|
|
export class ExecutionEntity {
|
|
@Generated()
|
|
@PrimaryColumn({ transformer: idStringifier })
|
|
id: string;
|
|
|
|
@Column()
|
|
finished: boolean;
|
|
|
|
@Column('varchar')
|
|
mode: WorkflowExecuteMode;
|
|
|
|
@Column({ nullable: true })
|
|
retryOf: string;
|
|
|
|
@Column({ nullable: true })
|
|
retrySuccessId: string;
|
|
|
|
@Column('varchar', { nullable: true })
|
|
status: ExecutionStatus;
|
|
|
|
@Column(datetimeColumnType)
|
|
startedAt: Date;
|
|
|
|
@Index()
|
|
@Column({ type: datetimeColumnType, nullable: true })
|
|
stoppedAt: Date;
|
|
|
|
@Column(datetimeColumnType)
|
|
deletedAt: Date;
|
|
|
|
@Column({ nullable: true })
|
|
workflowId: string;
|
|
|
|
@Column({ type: datetimeColumnType, nullable: true })
|
|
waitTill: Date | null;
|
|
|
|
@OneToMany('ExecutionMetadata', 'execution')
|
|
metadata: ExecutionMetadata[];
|
|
|
|
@OneToOne('ExecutionData', 'execution')
|
|
executionData: Relation<ExecutionData>;
|
|
|
|
@ManyToOne('WorkflowEntity')
|
|
workflow: WorkflowEntity;
|
|
}
|