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