import { MigrationInterface, QueryRunner } from "typeorm";

export class UpdateProfileDevelopment21727851675456 implements MigrationInterface {
    name = 'UpdateProfileDevelopment21727851675456'

    public async up(queryRunner: QueryRunner): Promise<void> {
        await queryRunner.query(`ALTER TABLE \`commandRecive\` DROP COLUMN \`firstName\``);
        await queryRunner.query(`ALTER TABLE \`commandRecive\` DROP COLUMN \`lastName\``);
        await queryRunner.query(`ALTER TABLE \`commandRecive\` DROP COLUMN \`prefix\``);
        await queryRunner.query(`ALTER TABLE \`commandRecive\` ADD \`fullName\` varchar(255) NULL COMMENT 'ชื่อ-สกุล'`);
    }

    public async down(queryRunner: QueryRunner): Promise<void> {
        await queryRunner.query(`ALTER TABLE \`commandRecive\` DROP COLUMN \`fullName\``);
        await queryRunner.query(`ALTER TABLE \`commandRecive\` ADD \`prefix\` varchar(255) NULL COMMENT 'คำนำหน้า'`);
        await queryRunner.query(`ALTER TABLE \`commandRecive\` ADD \`lastName\` varchar(255) NULL COMMENT 'สกุล'`);
        await queryRunner.query(`ALTER TABLE \`commandRecive\` ADD \`firstName\` varchar(255) NULL COMMENT 'ชื่อ'`);
    }

}
