import { MigrationInterface, QueryRunner } from "typeorm";

export class UpdateCommandReciveAddSalary11727260590227 implements MigrationInterface {
    name = 'UpdateCommandReciveAddSalary11727260590227'

    public async up(queryRunner: QueryRunner): Promise<void> {
        await queryRunner.query(`ALTER TABLE \`commandRecive\` CHANGE \`fristName\` \`firstName\` varchar(255) NULL COMMENT 'ชื่อ'`);
        await queryRunner.query(`ALTER TABLE \`commandSend\` CHANGE \`fristName\` \`firstName\` varchar(255) NULL COMMENT 'ชื่อ'`);
        await queryRunner.query(`ALTER TABLE \`commandRecive\` DROP COLUMN \`firstName\``);
        await queryRunner.query(`ALTER TABLE \`commandRecive\` ADD \`firstName\` varchar(255) NULL COMMENT 'ชื่อ'`);
        await queryRunner.query(`ALTER TABLE \`commandSend\` DROP COLUMN \`firstName\``);
        await queryRunner.query(`ALTER TABLE \`commandSend\` ADD \`firstName\` varchar(255) NULL COMMENT 'ชื่อ'`);
    }

    public async down(queryRunner: QueryRunner): Promise<void> {
        await queryRunner.query(`ALTER TABLE \`commandSend\` DROP COLUMN \`firstName\``);
        await queryRunner.query(`ALTER TABLE \`commandSend\` ADD \`firstName\` varchar(255) NULL COMMENT 'ชื่อ'`);
        await queryRunner.query(`ALTER TABLE \`commandRecive\` DROP COLUMN \`firstName\``);
        await queryRunner.query(`ALTER TABLE \`commandRecive\` ADD \`firstName\` varchar(255) NULL COMMENT 'ชื่อ'`);
        await queryRunner.query(`ALTER TABLE \`commandSend\` CHANGE \`firstName\` \`fristName\` varchar(255) NULL COMMENT 'ชื่อ'`);
        await queryRunner.query(`ALTER TABLE \`commandRecive\` CHANGE \`firstName\` \`fristName\` varchar(255) NULL COMMENT 'ชื่อ'`);
    }

}
