import { MigrationInterface, QueryRunner } from 'typeorm'; export class createCauseTable1585841242251 implements MigrationInterface { name = 'createCauseTable1585841242251'; public async up(queryRunner: QueryRunner): Promise { await queryRunner.query( `CREATE TABLE "cause" ("id" SERIAL NOT NULL, "name" character varying NOT NULL, "createdAt" TIMESTAMP NOT NULL DEFAULT now(), "updatedAt" TIMESTAMP NOT NULL DEFAULT now(), "deletedAt" TIMESTAMP, "version" integer NOT NULL, CONSTRAINT "UQ_be2e7015c35f98d5d6926201cee" UNIQUE ("name"), CONSTRAINT "PK_7e5e70955edaf3bb0c56d8eeb49" PRIMARY KEY ("id"))`, undefined, ); } public async down(queryRunner: QueryRunner): Promise { await queryRunner.query(`DROP TABLE "cause"`, undefined); } }