import { MigrationInterface, QueryRunner } from "typeorm";

export class AddFieldsPrivacy1768555527430 implements MigrationInterface {
    name = 'AddFieldsPrivacy1768555527430'

    public async up(queryRunner: QueryRunner): Promise<void> {
        await queryRunner.query(`ALTER TABLE \`profileEmployee\` ADD \`privacyCheckin\` tinyint NOT NULL COMMENT 'สถานะยืนยัน privacyCheckin' DEFAULT 0`);
        await queryRunner.query(`ALTER TABLE \`profileEmployee\` ADD \`privacyUser\` tinyint NOT NULL COMMENT 'สถานะยืนยัน privacyUser' DEFAULT 0`);
        await queryRunner.query(`ALTER TABLE \`profileEmployee\` ADD \`privacyMgt\` tinyint NOT NULL COMMENT 'สถานะยืนยัน privacyMgt' DEFAULT 0`);
        await queryRunner.query(`ALTER TABLE \`profileEmployeeHistory\` ADD \`privacyCheckin\` tinyint NOT NULL COMMENT 'สถานะยืนยัน privacyCheckin' DEFAULT 0`);
        await queryRunner.query(`ALTER TABLE \`profileEmployeeHistory\` ADD \`privacyUser\` tinyint NOT NULL COMMENT 'สถานะยืนยัน privacyUser' DEFAULT 0`);
        await queryRunner.query(`ALTER TABLE \`profileEmployeeHistory\` ADD \`privacyMgt\` tinyint NOT NULL COMMENT 'สถานะยืนยัน privacyMgt' DEFAULT 0`);
        await queryRunner.query(`ALTER TABLE \`profile\` ADD \`privacyCheckin\` tinyint NOT NULL COMMENT 'สถานะยืนยัน privacyCheckin' DEFAULT 0`);
        await queryRunner.query(`ALTER TABLE \`profile\` ADD \`privacyUser\` tinyint NOT NULL COMMENT 'สถานะยืนยัน privacyUser' DEFAULT 0`);
        await queryRunner.query(`ALTER TABLE \`profile\` ADD \`privacyMgt\` tinyint NOT NULL COMMENT 'สถานะยืนยัน privacyMgt' DEFAULT 0`);
        await queryRunner.query(`ALTER TABLE \`profileHistory\` ADD \`privacyCheckin\` tinyint NOT NULL COMMENT 'สถานะยืนยัน privacyCheckin' DEFAULT 0`);
        await queryRunner.query(`ALTER TABLE \`profileHistory\` ADD \`privacyUser\` tinyint NOT NULL COMMENT 'สถานะยืนยัน privacyUser' DEFAULT 0`);
        await queryRunner.query(`ALTER TABLE \`profileHistory\` ADD \`privacyMgt\` tinyint NOT NULL COMMENT 'สถานะยืนยัน privacyMgt' DEFAULT 0`);
}

    public async down(queryRunner: QueryRunner): Promise<void> {

        await queryRunner.query(`ALTER TABLE \`profileHistory\` DROP COLUMN \`privacyMgt\``);
        await queryRunner.query(`ALTER TABLE \`profileHistory\` DROP COLUMN \`privacyUser\``);
        await queryRunner.query(`ALTER TABLE \`profileHistory\` DROP COLUMN \`privacyCheckin\``);
        await queryRunner.query(`ALTER TABLE \`profile\` DROP COLUMN \`privacyMgt\``);
        await queryRunner.query(`ALTER TABLE \`profile\` DROP COLUMN \`privacyUser\``);
        await queryRunner.query(`ALTER TABLE \`profile\` DROP COLUMN \`privacyCheckin\``);
        await queryRunner.query(`ALTER TABLE \`profileEmployeeHistory\` DROP COLUMN \`privacyMgt\``);
        await queryRunner.query(`ALTER TABLE \`profileEmployeeHistory\` DROP COLUMN \`privacyUser\``);
        await queryRunner.query(`ALTER TABLE \`profileEmployeeHistory\` DROP COLUMN \`privacyCheckin\``);
        await queryRunner.query(`ALTER TABLE \`profileEmployee\` DROP COLUMN \`privacyMgt\``);
        await queryRunner.query(`ALTER TABLE \`profileEmployee\` DROP COLUMN \`privacyUser\``);
        await queryRunner.query(`ALTER TABLE \`profileEmployee\` DROP COLUMN \`privacyCheckin\``);
    }

}
