diff --git a/src/migrations/1708534487221-migration.ts b/src/migrations/1708534487221-migration.ts index 224fb4c..d7a4ec0 100644 --- a/src/migrations/1708534487221-migration.ts +++ b/src/migrations/1708534487221-migration.ts @@ -1,10 +1,10 @@ -import { MigrationInterface, QueryRunner } from "typeorm"; +import {MigrationInterface, QueryRunner} from 'typeorm' export class Migration1708534487221 implements MigrationInterface { - name = 'Migration1708534487221' + name = 'Migration1708534487221' - public async up(queryRunner: QueryRunner): Promise { - await queryRunner.query(` + public async up(queryRunner: QueryRunner): Promise { + await queryRunner.query(` CREATE TABLE "profile" ( "id" uuid NOT NULL DEFAULT uuid_generate_v4(), "title" character varying NOT NULL, @@ -13,20 +13,19 @@ export class Migration1708534487221 implements MigrationInterface { "ownerId" uuid NOT NULL, CONSTRAINT "PK_3dd8bfc97e4a77c70971591bdcb" PRIMARY KEY ("id") ) - `); - await queryRunner.query(` + `) + await queryRunner.query(` ALTER TABLE "profile" ADD CONSTRAINT "FK_552aa6698bb78970f6569161ec0" FOREIGN KEY ("ownerId") REFERENCES "user"("id") ON DELETE CASCADE ON UPDATE NO ACTION - `); - } + `) + } - public async down(queryRunner: QueryRunner): Promise { - await queryRunner.query(` + public async down(queryRunner: QueryRunner): Promise { + await queryRunner.query(` ALTER TABLE "profile" DROP CONSTRAINT "FK_552aa6698bb78970f6569161ec0" - `); - await queryRunner.query(` + `) + await queryRunner.query(` DROP TABLE "profile" - `); - } - + `) + } }