fix(core): Upsert credentials and workflows in the import:* commands (#5231)

This commit is contained in:
कारतोफ्फेलस्क्रिप्ट™
2023-01-24 19:05:23 +01:00
committed by GitHub
parent 237b1d8614
commit 259296c5c9
3 changed files with 48 additions and 35 deletions

View File

@@ -0,0 +1,11 @@
import type { WorkflowEntity } from '@db/entities/WorkflowEntity';
import type { CredentialsEntity } from '@db/entities/CredentialsEntity';
import { getMetadataArgsStorage } from 'typeorm';
export const disableAutoGeneratedIds = (
entityClass: typeof WorkflowEntity | typeof CredentialsEntity,
): void => {
const decoratorMetadata = getMetadataArgsStorage().generations;
const index = decoratorMetadata.findIndex((metadata) => metadata.target === entityClass);
decoratorMetadata.splice(index, 1);
};