import { MigrationInterface, QueryRunner } from "typeorm";

export class UpdateProfilesalaryCommandId1729169375946 implements MigrationInterface {
    name = 'UpdateProfilesalaryCommandId1729169375946'

    public async up(queryRunner: QueryRunner): Promise<void> {
        await queryRunner.query(`ALTER TABLE \`profileSalary\` ADD \`commandId\` varchar(40) NULL COMMENT 'คีย์นอก(FK)ของตาราง command'`);
        await queryRunner.query(`ALTER TABLE \`profileSalary\` ADD CONSTRAINT \`FK_5aa33e13619d0c878032e2dc1bd\` FOREIGN KEY (\`commandId\`) REFERENCES \`command\`(\`id\`) ON DELETE NO ACTION ON UPDATE NO ACTION`);
    }

    public async down(queryRunner: QueryRunner): Promise<void> {
        await queryRunner.query(`ALTER TABLE \`profileSalary\` DROP FOREIGN KEY \`FK_5aa33e13619d0c878032e2dc1bd\``);
        await queryRunner.query(`ALTER TABLE \`profileSalary\` DROP COLUMN \`commandId\``);
    }

}
