import { MigrationInterface, QueryRunner } from 'typeorm'; export class FileStorage1599486578373 implements MigrationInterface { name = 'FileStorage1599486578373'; public async up(queryRunner: QueryRunner): Promise { await queryRunner.query( `CREATE TABLE "file" ("createdAt" TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT now(), "updatedAt" TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT now(), "id" uuid NOT NULL DEFAULT uuid_generate_v4(), "filename" character varying NOT NULL, "data" bytea NOT NULL, CONSTRAINT "PK_36b46d232307066b3a2c9ea3a1d" PRIMARY KEY ("id"))` ); } public async down(queryRunner: QueryRunner): Promise { await queryRunner.query(`DROP TABLE "file"`); } }