mirror of
https://github.com/HamzaSha1/zod-backend.git
synced 2025-08-25 05:42:27 +00:00
37 lines
1.1 KiB
TypeScript
37 lines
1.1 KiB
TypeScript
import { MigrationInterface, QueryRunner } from 'typeorm';
|
|
|
|
export class UpdateCustomerTable1742112997024 implements MigrationInterface {
|
|
name = 'UpdateCustomerTable1742112997024';
|
|
|
|
public async up(queryRunner: QueryRunner): Promise<void> {
|
|
await queryRunner.query(`
|
|
ALTER TABLE "customers"
|
|
RENAME COLUMN "createdAt"
|
|
TO "created_at"
|
|
`);
|
|
|
|
await queryRunner.query(`
|
|
ALTER TABLE "customers"
|
|
RENAME COLUMN "updatedAt"
|
|
TO "updated_at"
|
|
`);
|
|
await queryRunner.query(`ALTER TABLE "customers" ADD "waiting_number" SERIAL NOT NULL`);
|
|
}
|
|
|
|
public async down(queryRunner: QueryRunner): Promise<void> {
|
|
await queryRunner.query(`ALTER TABLE "customers" DROP COLUMN "waiting_number"`);
|
|
|
|
await queryRunner.query(`
|
|
ALTER TABLE "customers"
|
|
RENAME COLUMN "created_at"
|
|
TO "createdAt"
|
|
`);
|
|
|
|
await queryRunner.query(`
|
|
ALTER TABLE "customers"
|
|
RENAME COLUMN "updated_at"
|
|
TO "updatedAt"
|
|
`);
|
|
}
|
|
}
|