feat: check for cred when updating workflow and remove credential_usage table (#4350) (no-changelog)
* feat: check for cred when updating workflow and remove credential_usage table
This commit is contained in:
@@ -1,28 +0,0 @@
|
||||
import { Entity, ManyToOne, PrimaryColumn, RelationId } from 'typeorm';
|
||||
import { WorkflowEntity } from './WorkflowEntity';
|
||||
import { CredentialsEntity } from './CredentialsEntity';
|
||||
import { AbstractEntity } from './AbstractEntity';
|
||||
|
||||
@Entity()
|
||||
export class CredentialUsage extends AbstractEntity {
|
||||
@ManyToOne(() => WorkflowEntity, {
|
||||
onDelete: 'CASCADE',
|
||||
})
|
||||
workflow: WorkflowEntity;
|
||||
|
||||
@ManyToOne(() => CredentialsEntity, {
|
||||
onDelete: 'CASCADE',
|
||||
})
|
||||
credential: CredentialsEntity;
|
||||
|
||||
@RelationId((credentialUsage: CredentialUsage) => credentialUsage.workflow)
|
||||
@PrimaryColumn()
|
||||
workflowId: number;
|
||||
|
||||
@PrimaryColumn()
|
||||
nodeId: string;
|
||||
|
||||
@RelationId((credentialUsage: CredentialUsage) => credentialUsage.credential)
|
||||
@PrimaryColumn()
|
||||
credentialId: string;
|
||||
}
|
||||
@@ -11,7 +11,6 @@ import { SharedWorkflow } from './SharedWorkflow';
|
||||
import { SharedCredentials } from './SharedCredentials';
|
||||
import { InstalledPackages } from './InstalledPackages';
|
||||
import { InstalledNodes } from './InstalledNodes';
|
||||
import { CredentialUsage } from './CredentialUsage';
|
||||
|
||||
export const entities = {
|
||||
CredentialsEntity,
|
||||
@@ -26,5 +25,4 @@ export const entities = {
|
||||
SharedCredentials,
|
||||
InstalledPackages,
|
||||
InstalledNodes,
|
||||
CredentialUsage,
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user