All files / src/modules/common/database/postgres/account/migrations 1740495991982-add-column-comments.ts

0% Statements 0/12
100% Branches 0/0
0% Functions 0/2
0% Lines 0/12

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22                                           
import { MigrationInterface, QueryRunner } from 'typeorm';
 
export class AddColumnComments1740495991982 implements MigrationInterface {
  name = 'AddColumnComments1740495991982';
 
  public async up(queryRunner: QueryRunner): Promise<void> {
    await queryRunner.query(`COMMENT ON COLUMN "user_info"."user_id" IS 'Primary key'`);
    await queryRunner.query(`COMMENT ON COLUMN "user_info"."email" IS 'User email'`);
    await queryRunner.query(`COMMENT ON COLUMN "user_info"."phone" IS 'User phone number'`);
    await queryRunner.query(`COMMENT ON COLUMN "user_info"."created_at" IS 'Creation date'`);
    await queryRunner.query(`COMMENT ON COLUMN "user_info"."updated_at" IS 'Last update date'`);
  }
 
  public async down(queryRunner: QueryRunner): Promise<void> {
    await queryRunner.query(`COMMENT ON COLUMN "user_info"."updated_at" IS NULL`);
    await queryRunner.query(`COMMENT ON COLUMN "user_info"."created_at" IS NULL`);
    await queryRunner.query(`COMMENT ON COLUMN "user_info"."phone" IS NULL`);
    await queryRunner.query(`COMMENT ON COLUMN "user_info"."email" IS NULL`);
    await queryRunner.query(`COMMENT ON COLUMN "user_info"."user_id" IS NULL`);
  }
}