mirror of
https://github.com/HamzaSha1/zod-backend.git
synced 2025-08-26 06:09:41 +00:00
feat: add waiting number and handle resent otp
This commit is contained in:
36
src/db/migrations/1742112997024-update-customer-table.ts
Normal file
36
src/db/migrations/1742112997024-update-customer-table.ts
Normal file
@ -0,0 +1,36 @@
|
||||
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"
|
||||
`);
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user