mirror of
https://github.com/HamzaSha1/zod-backend.git
synced 2025-08-26 06:09:41 +00:00
21 lines
720 B
TypeScript
21 lines
720 B
TypeScript
import { MigrationInterface, QueryRunner } from 'typeorm';
|
|
|
|
export class CreateTemplateTable1731310840593 implements MigrationInterface {
|
|
name = 'CreateTemplateTable1731310840593';
|
|
|
|
public async up(queryRunner: QueryRunner): Promise<void> {
|
|
await queryRunner.query(
|
|
`CREATE TABLE "template" (
|
|
"id" SERIAL,
|
|
"name" character varying(255) NOT NULL,
|
|
"createdAt" TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT now(),
|
|
"updatedAt" TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT now(),
|
|
CONSTRAINT "PK_ac51aa5181ee2036f5ca482857d" PRIMARY KEY ("id"))`,
|
|
);
|
|
}
|
|
|
|
public async down(queryRunner: QueryRunner): Promise<void> {
|
|
await queryRunner.query(`DROP TABLE "template"`);
|
|
}
|
|
}
|