diff --git a/src/entities/kpiUserEvaluationReasonPlan.ts b/src/entities/kpiUserEvaluationReasonPlan.ts index 3d5b9b7..6517f4c 100644 --- a/src/entities/kpiUserEvaluationReasonPlan.ts +++ b/src/entities/kpiUserEvaluationReasonPlan.ts @@ -68,6 +68,6 @@ export class KpiUserEvaluationReasonPlan extends EntityBase { kpiUserPlannedId: string; @ManyToOne(() => KpiUserPlanned, (kpiUserPlanned) => kpiUserPlanned.kpiUserEvaluationReasonPlans) - @JoinColumn({ name: "kpiUserPlanId" }) + @JoinColumn({ name: "kpiUserPlannedId" }) kpiUserPlanned: KpiUserPlanned; } diff --git a/src/migration/1715592621069-rename_relations_kpiUserPlanned.ts b/src/migration/1715592621069-rename_relations_kpiUserPlanned.ts new file mode 100644 index 0000000..f541ffb --- /dev/null +++ b/src/migration/1715592621069-rename_relations_kpiUserPlanned.ts @@ -0,0 +1,18 @@ +import { MigrationInterface, QueryRunner } from "typeorm"; + +export class RenameRelationsKpiUserPlanned1715592621069 implements MigrationInterface { + name = 'RenameRelationsKpiUserPlanned1715592621069' + + public async up(queryRunner: QueryRunner): Promise { + await queryRunner.query(`ALTER TABLE \`kpiUserEvaluationReasonPlan\` DROP FOREIGN KEY \`FK_6eda960b0eada6c174ac4a6ffb8\``); + await queryRunner.query(`ALTER TABLE \`kpiUserEvaluationReasonPlan\` DROP COLUMN \`kpiUserPlanId\``); + await queryRunner.query(`ALTER TABLE \`kpiUserEvaluationReasonPlan\` ADD CONSTRAINT \`FK_704d587bd08b64d8ecb577bcebe\` FOREIGN KEY (\`kpiUserPlannedId\`) REFERENCES \`kpiUserPlanned\`(\`id\`) ON DELETE NO ACTION ON UPDATE NO ACTION`); + } + + public async down(queryRunner: QueryRunner): Promise { + await queryRunner.query(`ALTER TABLE \`kpiUserEvaluationReasonPlan\` DROP FOREIGN KEY \`FK_704d587bd08b64d8ecb577bcebe\``); + await queryRunner.query(`ALTER TABLE \`kpiUserEvaluationReasonPlan\` ADD \`kpiUserPlanId\` varchar(36) NULL`); + await queryRunner.query(`ALTER TABLE \`kpiUserEvaluationReasonPlan\` ADD CONSTRAINT \`FK_6eda960b0eada6c174ac4a6ffb8\` FOREIGN KEY (\`kpiUserPlanId\`) REFERENCES \`kpiUserPlanned\`(\`id\`) ON DELETE NO ACTION ON UPDATE NO ACTION`); + } + +}