feat: Add workflow history repository files (no-changelog) (#7071)

This commit is contained in:
Omar Ajoue
2023-09-06 12:23:40 +02:00
committed by GitHub
parent 689a77cc87
commit 25dc4d7825
7 changed files with 55 additions and 0 deletions

View File

@@ -0,0 +1,28 @@
import { Column, Entity, ManyToOne, PrimaryColumn } from 'typeorm';
import { jsonColumnType } from './AbstractEntity';
import { IConnections } from 'n8n-workflow';
import type { INode } from 'n8n-workflow';
import { WorkflowEntity } from './WorkflowEntity';
@Entity()
export class WorkflowHistory {
@PrimaryColumn()
versionId: string;
@Column()
workflowId: string;
@Column(jsonColumnType)
nodes: INode[];
@Column(jsonColumnType)
connections: IConnections;
@Column()
authors: string;
@ManyToOne('WorkflowEntity', {
onDelete: 'CASCADE',
})
workflow: WorkflowEntity;
}

View File

@@ -19,6 +19,7 @@ import { WorkflowTagMapping } from './WorkflowTagMapping';
import { WorkflowStatistics } from './WorkflowStatistics';
import { ExecutionMetadata } from './ExecutionMetadata';
import { ExecutionData } from './ExecutionData';
import { WorkflowHistory } from './WorkflowHistory';
export const entities = {
AuthIdentity,
@@ -41,4 +42,5 @@ export const entities = {
WorkflowStatistics,
ExecutionMetadata,
ExecutionData,
WorkflowHistory,
};

View File

@@ -15,6 +15,7 @@ export { TagRepository } from './tag.repository';
export { UserRepository } from './user.repository';
export { VariablesRepository } from './variables.repository';
export { WebhookRepository } from './webhook.repository';
export { WorkflowHistoryRepository } from './workflowHistory.repository';
export { WorkflowRepository } from './workflow.repository';
export { WorkflowStatisticsRepository } from './workflowStatistics.repository';
export { WorkflowTagMappingRepository } from './workflowTagMapping.repository';

View File

@@ -0,0 +1,10 @@
import { Service } from 'typedi';
import { DataSource, Repository } from 'typeorm';
import { WorkflowHistory } from '../entities/WorkflowHistory';
@Service()
export class WorkflowHistoryRepository extends Repository<WorkflowHistory> {
constructor(dataSource: DataSource) {
super(WorkflowHistory, dataSource.manager);
}
}