Spaces:
Sleeping
Sleeping
import { MigrationInterface, QueryRunner } from 'typeorm'; | |
export class UpdateOrderFieldTime1730895089788 implements MigrationInterface { | |
name = 'UpdateOrderFieldTime1730895089788'; | |
public async up(queryRunner: QueryRunner): Promise<void> { | |
await queryRunner.query(`ALTER TABLE "orders" DROP COLUMN "create_at"`); | |
await queryRunner.query( | |
`ALTER TABLE "orders" ADD "created_at" TIMESTAMP NOT NULL DEFAULT now()`, | |
); | |
await queryRunner.query( | |
`ALTER TABLE "orders" ADD "updated_at" TIMESTAMP NOT NULL DEFAULT now()`, | |
); | |
await queryRunner.query(`ALTER TABLE "orders" ADD "deleted_at" TIMESTAMP`); | |
} | |
public async down(queryRunner: QueryRunner): Promise<void> { | |
await queryRunner.query( | |
`ALTER TABLE "orders" ADD "create_at" TIMESTAMP NOT NULL DEFAULT now()`, | |
); | |
await queryRunner.query(`ALTER TABLE "orders" DROP COLUMN "deleted_at"`); | |
await queryRunner.query(`ALTER TABLE "orders" DROP COLUMN "updated_at"`); | |
await queryRunner.query(`ALTER TABLE "orders" DROP COLUMN "created_at"`); | |
} | |
} | |