Files
zod-backend/src/db/migrations/1732434281561-create-document-entity.ts
T

23 lines
839 B
TypeScript

import { MigrationInterface, QueryRunner } from 'typeorm';
export class CreateDocumentEntity1732434281561 implements MigrationInterface {
name = 'CreateDocumentEntity1732434281561';
public async up(queryRunner: QueryRunner): Promise<void> {
await queryRunner.query(
`CREATE TABLE "documents" (
"id" uuid NOT NULL DEFAULT uuid_generate_v4(),
"name" character varying(255) NOT NULL,
"extension" character varying(255) NOT NULL,
"documentType" character varying(255) NOT NULL,
"updated_at" TIMESTAMP NOT NULL DEFAULT now(),
"created_at" TIMESTAMP NOT NULL DEFAULT now(),
CONSTRAINT "PK_ac51aa5181ee2036f5ca482857c" PRIMARY KEY ("id"))`,
);
}
public async down(queryRunner: QueryRunner): Promise<void> {
await queryRunner.query(`DROP TABLE "documents"`);
}
}