import { MigrationInterface, QueryRunner } from "typeorm";

export class AddEmailPhoneToIssues1738627400000 implements MigrationInterface {
    name = 'AddEmailPhoneToIssues1738627400000'

    public async up(queryRunner: QueryRunner): Promise<void> {
       
        await queryRunner.query(`
            ALTER TABLE \`issues\` 
            ADD \`email\` varchar(255) NULL COMMENT 'อีเมลผู้รายงาน'
        `);

        await queryRunner.query(`
            ALTER TABLE \`issues\` 
            ADD \`phone\` varchar(20) NULL COMMENT 'เบอร์โทรผู้รายงาน'
        `);
    }

    public async down(queryRunner: QueryRunner): Promise<void> {
        await queryRunner.query(`ALTER TABLE \`issues\` DROP COLUMN \`phone\``);
        await queryRunner.query(`ALTER TABLE \`issues\` DROP COLUMN \`email\``);
    }
}