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