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