File size: 1,157 Bytes
9e8f9e3
 
766d2fb
 
9e8f9e3
 
 
 
 
 
766d2fb
9e8f9e3
 
 
766d2fb
9e8f9e3
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
import { MigrationInterface, QueryRunner } from "typeorm";

export class AddBranchAndOrderFields1730865796585 implements MigrationInterface {
    name = 'AddBranchAndOrderFields1730865796585'

    public async up(queryRunner: QueryRunner): Promise<void> {
        await queryRunner.query(`ALTER TABLE "feeds" ADD "delete_at" TIMESTAMP`);
        await queryRunner.query(`ALTER TABLE "menu_items" ADD "delete_at" TIMESTAMP`);
        await queryRunner.query(`ALTER TABLE "branches" ADD "delete_at" TIMESTAMP`);
        await queryRunner.query(`ALTER TABLE "orders" ADD "note" character varying`);
        await queryRunner.query(`ALTER TABLE "orders" ADD "rating" integer`);
    }

    public async down(queryRunner: QueryRunner): Promise<void> {
        await queryRunner.query(`ALTER TABLE "orders" DROP COLUMN "rating"`);
        await queryRunner.query(`ALTER TABLE "orders" DROP COLUMN "note"`);
        await queryRunner.query(`ALTER TABLE "branches" DROP COLUMN "delete_at"`);
        await queryRunner.query(`ALTER TABLE "menu_items" DROP COLUMN "delete_at"`);
        await queryRunner.query(`ALTER TABLE "feeds" DROP COLUMN "delete_at"`);
    }

}