From 73be69cb30f67691e29e9cc431849403f0aadd08 Mon Sep 17 00:00:00 2001 From: Gbuntu Date: Sun, 29 Oct 2023 15:41:45 +0330 Subject: [PATCH] migration fix --- src/db/migrations/1698395142941-new.ts | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 src/db/migrations/1698395142941-new.ts diff --git a/src/db/migrations/1698395142941-new.ts b/src/db/migrations/1698395142941-new.ts new file mode 100644 index 000000000..daaef1e1e --- /dev/null +++ b/src/db/migrations/1698395142941-new.ts @@ -0,0 +1,16 @@ +import { MigrationInterface, QueryRunner } from 'typeorm'; + +export class New1698395142941 implements MigrationInterface { + name = 'New1698395142941'; + + public async up(queryRunner: QueryRunner): Promise { + await queryRunner.query( + `CREATE TABLE "children_pre_register_entity" ("id" uuid NOT NULL DEFAULT uuid_generate_v4(), "createdAt" TIMESTAMP NOT NULL DEFAULT now(), "updatedAt" TIMESTAMP NOT NULL DEFAULT now(), "deletedAt" TIMESTAMP WITH TIME ZONE, "awakeUrl" character varying NOT NULL, "sleptUrl" character varying NOT NULL, "sayName" hstore NOT NULL, "firstName" hstore, "lastName" hstore, "bio" character varying, "birthDate" TIMESTAMP WITH TIME ZONE, "birthPlace" integer, "city" integer, "state" integer, "country" integer, "sex" integer, "education" integer, "housingStatus" integer, "flaskSwId" integer, "address" character varying, "familyCount" integer, "phoneNumber" character varying, "flaskNgoId" integer, "voiceUrl" character varying, "isApproved" boolean DEFAULT false, "locationId" uuid, CONSTRAINT "PK_a06984f3a83b097b1dc2c8bf2a0" PRIMARY KEY ("id"))`, + ); + } + public async down(queryRunner: QueryRunner): Promise { + await queryRunner.query( + `ALTER TABLE "children_pre_register_entity" DROP CONSTRAINT "FK_2b2ec4ae41b2b9a3c6a48054d45"`, + ); + } +}