mirror of
https://github.com/HamzaSha1/zod-backend.git
synced 2026-10-25 16:17:57 +00:00
23 lines
839 B
TypeScript
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"`);
|
|
}
|
|
}
|