import { MigrationInterface, QueryRunner } from 'typeorm'; export class linkFactoryProcess1585737289298 implements MigrationInterface { name = 'linkFactoryProcess1585737289298'; public async up(queryRunner: QueryRunner): Promise { await queryRunner.query( `ALTER TABLE "process" ADD "factoryId" integer`, undefined, ); await queryRunner.query( `ALTER TABLE "process" ADD CONSTRAINT "FK_328a37ebac247d3cf5e350ff68c" FOREIGN KEY ("factoryId") REFERENCES "factory"("id") ON DELETE NO ACTION ON UPDATE NO ACTION`, undefined, ); } public async down(queryRunner: QueryRunner): Promise { await queryRunner.query( `ALTER TABLE "process" DROP CONSTRAINT "FK_328a37ebac247d3cf5e350ff68c"`, undefined, ); await queryRunner.query( `ALTER TABLE "process" DROP COLUMN "factoryId"`, undefined, ); } }