fix(core): Upsert credentials and workflows in the import:* commands (#5231)
This commit is contained in:
committed by
GitHub
parent
237b1d8614
commit
259296c5c9
11
packages/cli/src/databases/utils/commandHelpers.ts
Normal file
11
packages/cli/src/databases/utils/commandHelpers.ts
Normal 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);
|
||||
};
|
||||
Reference in New Issue
Block a user