import { MigrationInterface, QueryRunner } from "typeorm";

export class NewDatabaseConnection1786251383867 implements MigrationInterface {
    name = 'NewDatabaseConnection1786251383867'

    public async up(queryRunner: QueryRunner): Promise<void> {
        try { await queryRunner.query(`DROP INDEX \`IDX_e2591ca208fbc53b3e82b9f28c\` ON \`final_settlements\``); } catch (e) {}
        try { await queryRunner.query(`ALTER TABLE \`onboarding_templates\` ADD \`is_default\` tinyint NOT NULL DEFAULT 0`); } catch (e) {}
        try { await queryRunner.query(`ALTER TABLE \`owner\` CHANGE \`created_at\` \`created_at\` datetime(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3)`); } catch (e) {}
        try { await queryRunner.query(`ALTER TABLE \`owner\` CHANGE \`updated_at\` \`updated_at\` datetime(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)`); } catch (e) {}
        try { await queryRunner.query(`ALTER TABLE \`company\` CHANGE \`created_at\` \`created_at\` datetime(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3)`); } catch (e) {}
        try { await queryRunner.query(`ALTER TABLE \`company\` CHANGE \`updated_at\` \`updated_at\` datetime(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)`); } catch (e) {}
        try { await queryRunner.query(`ALTER TABLE \`working_schedule\` CHANGE \`created_at\` \`created_at\` datetime(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3)`); } catch (e) {}
        try { await queryRunner.query(`ALTER TABLE \`working_schedule\` CHANGE \`updated_at\` \`updated_at\` datetime(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)`); } catch (e) {}
        try { await queryRunner.query(`ALTER TABLE \`leave_policy\` CHANGE \`created_at\` \`created_at\` datetime(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3)`); } catch (e) {}
        try { await queryRunner.query(`ALTER TABLE \`leave_policy\` CHANGE \`updated_at\` \`updated_at\` datetime(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)`); } catch (e) {}
        try { await queryRunner.query(`ALTER TABLE \`departments\` CHANGE \`created_at\` \`created_at\` datetime(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3)`); } catch (e) {}
        try { await queryRunner.query(`ALTER TABLE \`departments\` CHANGE \`updated_at\` \`updated_at\` datetime(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)`); } catch (e) {}
        try { await queryRunner.query(`ALTER TABLE \`designations\` CHANGE \`created_at\` \`created_at\` datetime(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3)`); } catch (e) {}
        try { await queryRunner.query(`ALTER TABLE \`designations\` CHANGE \`updated_at\` \`updated_at\` datetime(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)`); } catch (e) {}
        try { await queryRunner.query(`ALTER TABLE \`locations\` CHANGE \`created_at\` \`created_at\` datetime(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3)`); } catch (e) {}
        try { await queryRunner.query(`ALTER TABLE \`locations\` CHANGE \`updated_at\` \`updated_at\` datetime(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)`); } catch (e) {}
        try { await queryRunner.query(`ALTER TABLE \`employement_types\` CHANGE \`created_at\` \`created_at\` datetime(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3)`); } catch (e) {}
        try { await queryRunner.query(`ALTER TABLE \`employement_types\` CHANGE \`updated_at\` \`updated_at\` datetime(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)`); } catch (e) {}
        try { await queryRunner.query(`ALTER TABLE \`hiring_sources\` CHANGE \`created_at\` \`created_at\` datetime(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3)`); } catch (e) {}
        try { await queryRunner.query(`ALTER TABLE \`hiring_sources\` CHANGE \`updated_at\` \`updated_at\` datetime(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)`); } catch (e) {}
        try { await queryRunner.query(`ALTER TABLE \`events\` CHANGE \`created_at\` \`created_at\` datetime(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3)`); } catch (e) {}
        try { await queryRunner.query(`ALTER TABLE \`events\` CHANGE \`updated_at\` \`updated_at\` datetime(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)`); } catch (e) {}
        try { await queryRunner.query(`ALTER TABLE \`notices\` CHANGE \`created_at\` \`created_at\` datetime(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3)`); } catch (e) {}
        try { await queryRunner.query(`ALTER TABLE \`notices\` CHANGE \`updated_at\` \`updated_at\` datetime(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)`); } catch (e) {}
        try { await queryRunner.query(`ALTER TABLE \`members\` CHANGE \`created_at\` \`created_at\` datetime(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3)`); } catch (e) {}
        try { await queryRunner.query(`ALTER TABLE \`members\` CHANGE \`updated_at\` \`updated_at\` datetime(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)`); } catch (e) {}
        try { await queryRunner.query(`ALTER TABLE \`work_experiences\` CHANGE \`created_at\` \`created_at\` datetime(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3)`); } catch (e) {}
        try { await queryRunner.query(`ALTER TABLE \`work_experiences\` CHANGE \`updated_at\` \`updated_at\` datetime(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)`); } catch (e) {}
        try { await queryRunner.query(`ALTER TABLE \`educations\` CHANGE \`created_at\` \`created_at\` datetime(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3)`); } catch (e) {}
        try { await queryRunner.query(`ALTER TABLE \`educations\` CHANGE \`updated_at\` \`updated_at\` datetime(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)`); } catch (e) {}
        try { await queryRunner.query(`ALTER TABLE \`attendance_breaks\` CHANGE \`created_at\` \`created_at\` datetime(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3)`); } catch (e) {}
        try { await queryRunner.query(`ALTER TABLE \`attendance_breaks\` CHANGE \`updated_at\` \`updated_at\` datetime(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)`); } catch (e) {}
        try { await queryRunner.query(`ALTER TABLE \`attendances\` CHANGE \`created_at\` \`created_at\` datetime(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3)`); } catch (e) {}
        try { await queryRunner.query(`ALTER TABLE \`attendances\` CHANGE \`updated_at\` \`updated_at\` datetime(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)`); } catch (e) {}
        try { await queryRunner.query(`ALTER TABLE \`leaves\` CHANGE \`created_at\` \`created_at\` datetime(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3)`); } catch (e) {}
        try { await queryRunner.query(`ALTER TABLE \`leaves\` CHANGE \`updated_at\` \`updated_at\` datetime(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)`); } catch (e) {}
        try { await queryRunner.query(`ALTER TABLE \`attendance_requests\` CHANGE \`created_at\` \`created_at\` datetime(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3)`); } catch (e) {}
        try { await queryRunner.query(`ALTER TABLE \`attendance_requests\` CHANGE \`updated_at\` \`updated_at\` datetime(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)`); } catch (e) {}
        try { await queryRunner.query(`ALTER TABLE \`holidays\` CHANGE \`created_at\` \`created_at\` datetime(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3)`); } catch (e) {}
        try { await queryRunner.query(`ALTER TABLE \`holidays\` CHANGE \`updated_at\` \`updated_at\` datetime(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)`); } catch (e) {}
        try { await queryRunner.query(`ALTER TABLE \`job_postings\` CHANGE \`created_at\` \`created_at\` datetime(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3)`); } catch (e) {}
        try { await queryRunner.query(`ALTER TABLE \`job_postings\` CHANGE \`updated_at\` \`updated_at\` datetime(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)`); } catch (e) {}
        try { await queryRunner.query(`ALTER TABLE \`job_applications\` CHANGE \`created_at\` \`created_at\` datetime(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3)`); } catch (e) {}
        try { await queryRunner.query(`ALTER TABLE \`job_applications\` CHANGE \`updated_at\` \`updated_at\` datetime(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)`); } catch (e) {}
        try { await queryRunner.query(`ALTER TABLE \`recruitment_tasks\` CHANGE \`created_at\` \`created_at\` datetime(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3)`); } catch (e) {}
        try { await queryRunner.query(`ALTER TABLE \`recruitment_tasks\` CHANGE \`updated_at\` \`updated_at\` datetime(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)`); } catch (e) {}
        try { await queryRunner.query(`ALTER TABLE \`tenant_api_keys\` CHANGE \`created_at\` \`created_at\` datetime(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3)`); } catch (e) {}
        try { await queryRunner.query(`ALTER TABLE \`tenant_api_keys\` CHANGE \`updated_at\` \`updated_at\` datetime(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)`); } catch (e) {}
        try { await queryRunner.query(`ALTER TABLE \`onboarding_templates\` CHANGE \`created_at\` \`created_at\` datetime(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3)`); } catch (e) {}
        try { await queryRunner.query(`ALTER TABLE \`onboarding_templates\` CHANGE \`updated_at\` \`updated_at\` datetime(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)`); } catch (e) {}
        try { await queryRunner.query(`ALTER TABLE \`onboarding_template_tasks\` CHANGE \`created_at\` \`created_at\` datetime(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3)`); } catch (e) {}
        try { await queryRunner.query(`ALTER TABLE \`onboarding_template_tasks\` CHANGE \`updated_at\` \`updated_at\` datetime(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)`); } catch (e) {}
        try { await queryRunner.query(`ALTER TABLE \`onboarding_cases\` CHANGE \`created_at\` \`created_at\` datetime(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3)`); } catch (e) {}
        try { await queryRunner.query(`ALTER TABLE \`onboarding_cases\` CHANGE \`updated_at\` \`updated_at\` datetime(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)`); } catch (e) {}
        try { await queryRunner.query(`ALTER TABLE \`onboarding_tasks\` CHANGE \`created_at\` \`created_at\` datetime(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3)`); } catch (e) {}
        try { await queryRunner.query(`ALTER TABLE \`onboarding_tasks\` CHANGE \`updated_at\` \`updated_at\` datetime(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)`); } catch (e) {}
        try { await queryRunner.query(`ALTER TABLE \`onboarding_documents\` CHANGE \`created_at\` \`created_at\` datetime(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3)`); } catch (e) {}
        try { await queryRunner.query(`ALTER TABLE \`onboarding_documents\` CHANGE \`updated_at\` \`updated_at\` datetime(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)`); } catch (e) {}
        try { await queryRunner.query(`ALTER TABLE \`provisioning_items\` CHANGE \`created_at\` \`created_at\` datetime(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3)`); } catch (e) {}
        try { await queryRunner.query(`ALTER TABLE \`provisioning_items\` CHANGE \`updated_at\` \`updated_at\` datetime(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)`); } catch (e) {}
        try { await queryRunner.query(`ALTER TABLE \`buddy_assignments\` CHANGE \`created_at\` \`created_at\` datetime(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3)`); } catch (e) {}
        try { await queryRunner.query(`ALTER TABLE \`buddy_assignments\` CHANGE \`updated_at\` \`updated_at\` datetime(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)`); } catch (e) {}
        try { await queryRunner.query(`ALTER TABLE \`onboarding_surveys\` CHANGE \`created_at\` \`created_at\` datetime(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3)`); } catch (e) {}
        try { await queryRunner.query(`ALTER TABLE \`onboarding_surveys\` CHANGE \`updated_at\` \`updated_at\` datetime(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)`); } catch (e) {}
        try { await queryRunner.query(`ALTER TABLE \`probations\` CHANGE \`created_at\` \`created_at\` datetime(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3)`); } catch (e) {}
        try { await queryRunner.query(`ALTER TABLE \`probations\` CHANGE \`updated_at\` \`updated_at\` datetime(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)`); } catch (e) {}
        try { await queryRunner.query(`ALTER TABLE \`probation_reviews\` CHANGE \`created_at\` \`created_at\` datetime(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3)`); } catch (e) {}
        try { await queryRunner.query(`ALTER TABLE \`offboarding_templates\` CHANGE \`created_at\` \`created_at\` datetime(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3)`); } catch (e) {}
        try { await queryRunner.query(`ALTER TABLE \`offboarding_templates\` CHANGE \`updated_at\` \`updated_at\` datetime(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)`); } catch (e) {}
        try { await queryRunner.query(`ALTER TABLE \`offboarding_template_tasks\` CHANGE \`created_at\` \`created_at\` datetime(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3)`); } catch (e) {}
        try { await queryRunner.query(`ALTER TABLE \`offboarding_template_tasks\` CHANGE \`updated_at\` \`updated_at\` datetime(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)`); } catch (e) {}
        try { await queryRunner.query(`ALTER TABLE \`offboarding_cases\` CHANGE \`created_at\` \`created_at\` datetime(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3)`); } catch (e) {}
        try { await queryRunner.query(`ALTER TABLE \`offboarding_cases\` CHANGE \`updated_at\` \`updated_at\` datetime(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)`); } catch (e) {}
        try { await queryRunner.query(`ALTER TABLE \`offboarding_tasks\` CHANGE \`created_at\` \`created_at\` datetime(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3)`); } catch (e) {}
        try { await queryRunner.query(`ALTER TABLE \`offboarding_tasks\` CHANGE \`updated_at\` \`updated_at\` datetime(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)`); } catch (e) {}
        try { await queryRunner.query(`ALTER TABLE \`equipment_returns\` CHANGE \`created_at\` \`created_at\` datetime(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3)`); } catch (e) {}
        try { await queryRunner.query(`ALTER TABLE \`equipment_returns\` CHANGE \`updated_at\` \`updated_at\` datetime(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)`); } catch (e) {}
        try { await queryRunner.query(`ALTER TABLE \`exit_interview_templates\` CHANGE \`created_at\` \`created_at\` datetime(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3)`); } catch (e) {}
        try { await queryRunner.query(`ALTER TABLE \`exit_interview_templates\` CHANGE \`updated_at\` \`updated_at\` datetime(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)`); } catch (e) {}
        try { await queryRunner.query(`ALTER TABLE \`exit_interviews\` CHANGE \`created_at\` \`created_at\` datetime(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3)`); } catch (e) {}
        try { await queryRunner.query(`ALTER TABLE \`exit_interviews\` CHANGE \`updated_at\` \`updated_at\` datetime(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)`); } catch (e) {}
        try { await queryRunner.query(`ALTER TABLE \`final_settlements\` CHANGE \`created_at\` \`created_at\` datetime(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3)`); } catch (e) {}
        try { await queryRunner.query(`ALTER TABLE \`final_settlements\` CHANGE \`updated_at\` \`updated_at\` datetime(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)`); } catch (e) {}
        try { await queryRunner.query(`ALTER TABLE \`final_settlement_items\` CHANGE \`created_at\` \`created_at\` datetime(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3)`); } catch (e) {}
        try { await queryRunner.query(`CREATE INDEX \`IDX_e2591ca208fbc53b3e82b9f28c\` ON \`final_settlements\` (\`offboarding_case_id\`)`); } catch (e) {}
        try { await queryRunner.query(`ALTER TABLE \`attendance_requests\` ADD CONSTRAINT \`FK_df7290b8a7336c4e176c843a631\` FOREIGN KEY (\`member_id\`) REFERENCES \`members\`(\`id\`) ON DELETE RESTRICT ON UPDATE NO ACTION`); } catch (e) {}
        try { await queryRunner.query(`ALTER TABLE \`attendance_requests\` ADD CONSTRAINT \`FK_cb0102f5790efbd055116b40372\` FOREIGN KEY (\`owner_id\`) REFERENCES \`owner\`(\`id\`) ON DELETE RESTRICT ON UPDATE NO ACTION`); } catch (e) {}
        try { await queryRunner.query(`ALTER TABLE \`recruitment_tasks\` ADD CONSTRAINT \`FK_d8cce905e6febd44f2953b0e381\` FOREIGN KEY (\`application_id\`) REFERENCES \`job_applications\`(\`id\`) ON DELETE CASCADE ON UPDATE NO ACTION`); } catch (e) {}
        try { await queryRunner.query(`ALTER TABLE \`onboarding_cases\` ADD CONSTRAINT \`FK_4abc2ff047aae8b9ba650f3cc3d\` FOREIGN KEY (\`member_id\`) REFERENCES \`members\`(\`id\`) ON DELETE CASCADE ON UPDATE NO ACTION`); } catch (e) {}
        try { await queryRunner.query(`ALTER TABLE \`onboarding_tasks\` ADD CONSTRAINT \`FK_ea6a60e2a2934a4ab31502af80a\` FOREIGN KEY (\`assigned_member_id\`) REFERENCES \`members\`(\`id\`) ON DELETE SET NULL ON UPDATE NO ACTION`); } catch (e) {}
        try { await queryRunner.query(`ALTER TABLE \`buddy_assignments\` ADD CONSTRAINT \`FK_67b393cfc41ff53f4e81f5d544c\` FOREIGN KEY (\`member_id\`) REFERENCES \`members\`(\`id\`) ON DELETE CASCADE ON UPDATE NO ACTION`); } catch (e) {}
        try { await queryRunner.query(`ALTER TABLE \`buddy_assignments\` ADD CONSTRAINT \`FK_301494dc0352ad511100f98978e\` FOREIGN KEY (\`buddy_member_id\`) REFERENCES \`members\`(\`id\`) ON DELETE CASCADE ON UPDATE NO ACTION`); } catch (e) {}
        try { await queryRunner.query(`ALTER TABLE \`onboarding_surveys\` ADD CONSTRAINT \`FK_57fee15257cadb2bb4c007c3aa9\` FOREIGN KEY (\`member_id\`) REFERENCES \`members\`(\`id\`) ON DELETE CASCADE ON UPDATE NO ACTION`); } catch (e) {}
        try { await queryRunner.query(`ALTER TABLE \`probations\` ADD CONSTRAINT \`FK_4dca6f18819d45cfa75061a3a61\` FOREIGN KEY (\`member_id\`) REFERENCES \`members\`(\`id\`) ON DELETE CASCADE ON UPDATE NO ACTION`); } catch (e) {}
        try { await queryRunner.query(`ALTER TABLE \`probations\` ADD CONSTRAINT \`FK_0670a05467025d7e7e40d7321bf\` FOREIGN KEY (\`manager_id\`) REFERENCES \`members\`(\`id\`) ON DELETE SET NULL ON UPDATE NO ACTION`); } catch (e) {}
        try { await queryRunner.query(`ALTER TABLE \`offboarding_cases\` ADD CONSTRAINT \`FK_c1952ebec53e72e335f5cf4c732\` FOREIGN KEY (\`member_id\`) REFERENCES \`members\`(\`id\`) ON DELETE CASCADE ON UPDATE NO ACTION`); } catch (e) {}
        try { await queryRunner.query(`ALTER TABLE \`offboarding_tasks\` ADD CONSTRAINT \`FK_86e0b2b7658dc4c86db9e33fd98\` FOREIGN KEY (\`assigned_member_id\`) REFERENCES \`members\`(\`id\`) ON DELETE SET NULL ON UPDATE NO ACTION`); } catch (e) {}
        try { await queryRunner.query(`ALTER TABLE \`exit_interviews\` ADD CONSTRAINT \`FK_c81b8a0bb7d3a6009a8011f47e5\` FOREIGN KEY (\`member_id\`) REFERENCES \`members\`(\`id\`) ON DELETE CASCADE ON UPDATE NO ACTION`); } catch (e) {}
        try { await queryRunner.query(`ALTER TABLE \`final_settlements\` ADD CONSTRAINT \`FK_e2f7c6c39b76a619e54d3c16e98\` FOREIGN KEY (\`member_id\`) REFERENCES \`members\`(\`id\`) ON DELETE CASCADE ON UPDATE NO ACTION`); } catch (e) {}
    }

    public async down(queryRunner: QueryRunner): Promise<void> {
        await queryRunner.query(`ALTER TABLE \`final_settlements\` DROP FOREIGN KEY \`FK_e2f7c6c39b76a619e54d3c16e98\``);
        await queryRunner.query(`ALTER TABLE \`exit_interviews\` DROP FOREIGN KEY \`FK_c81b8a0bb7d3a6009a8011f47e5\``);
        await queryRunner.query(`ALTER TABLE \`offboarding_tasks\` DROP FOREIGN KEY \`FK_86e0b2b7658dc4c86db9e33fd98\``);
        await queryRunner.query(`ALTER TABLE \`offboarding_cases\` DROP FOREIGN KEY \`FK_c1952ebec53e72e335f5cf4c732\``);
        await queryRunner.query(`ALTER TABLE \`probations\` DROP FOREIGN KEY \`FK_0670a05467025d7e7e40d7321bf\``);
        await queryRunner.query(`ALTER TABLE \`probations\` DROP FOREIGN KEY \`FK_4dca6f18819d45cfa75061a3a61\``);
        await queryRunner.query(`ALTER TABLE \`onboarding_surveys\` DROP FOREIGN KEY \`FK_57fee15257cadb2bb4c007c3aa9\``);
        await queryRunner.query(`ALTER TABLE \`buddy_assignments\` DROP FOREIGN KEY \`FK_301494dc0352ad511100f98978e\``);
        await queryRunner.query(`ALTER TABLE \`buddy_assignments\` DROP FOREIGN KEY \`FK_67b393cfc41ff53f4e81f5d544c\``);
        await queryRunner.query(`ALTER TABLE \`onboarding_tasks\` DROP FOREIGN KEY \`FK_ea6a60e2a2934a4ab31502af80a\``);
        await queryRunner.query(`ALTER TABLE \`onboarding_cases\` DROP FOREIGN KEY \`FK_4abc2ff047aae8b9ba650f3cc3d\``);
        await queryRunner.query(`ALTER TABLE \`recruitment_tasks\` DROP FOREIGN KEY \`FK_d8cce905e6febd44f2953b0e381\``);
        await queryRunner.query(`ALTER TABLE \`attendance_requests\` DROP FOREIGN KEY \`FK_cb0102f5790efbd055116b40372\``);
        await queryRunner.query(`ALTER TABLE \`attendance_requests\` DROP FOREIGN KEY \`FK_df7290b8a7336c4e176c843a631\``);
        await queryRunner.query(`DROP INDEX \`IDX_e2591ca208fbc53b3e82b9f28c\` ON \`final_settlements\``);
        await queryRunner.query(`ALTER TABLE \`final_settlement_items\` CHANGE \`created_at\` \`created_at\` datetime(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3)`);
        await queryRunner.query(`ALTER TABLE \`final_settlements\` CHANGE \`updated_at\` \`updated_at\` datetime(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)`);
        await queryRunner.query(`ALTER TABLE \`final_settlements\` CHANGE \`created_at\` \`created_at\` datetime(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3)`);
        await queryRunner.query(`ALTER TABLE \`exit_interviews\` CHANGE \`updated_at\` \`updated_at\` datetime(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)`);
        await queryRunner.query(`ALTER TABLE \`exit_interviews\` CHANGE \`created_at\` \`created_at\` datetime(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3)`);
        await queryRunner.query(`ALTER TABLE \`exit_interview_templates\` CHANGE \`updated_at\` \`updated_at\` datetime(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)`);
        await queryRunner.query(`ALTER TABLE \`exit_interview_templates\` CHANGE \`created_at\` \`created_at\` datetime(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3)`);
        await queryRunner.query(`ALTER TABLE \`equipment_returns\` CHANGE \`updated_at\` \`updated_at\` datetime(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)`);
        await queryRunner.query(`ALTER TABLE \`equipment_returns\` CHANGE \`created_at\` \`created_at\` datetime(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3)`);
        await queryRunner.query(`ALTER TABLE \`offboarding_tasks\` CHANGE \`updated_at\` \`updated_at\` datetime(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)`);
        await queryRunner.query(`ALTER TABLE \`offboarding_tasks\` CHANGE \`created_at\` \`created_at\` datetime(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3)`);
        await queryRunner.query(`ALTER TABLE \`offboarding_cases\` CHANGE \`updated_at\` \`updated_at\` datetime(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)`);
        await queryRunner.query(`ALTER TABLE \`offboarding_cases\` CHANGE \`created_at\` \`created_at\` datetime(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3)`);
        await queryRunner.query(`ALTER TABLE \`offboarding_template_tasks\` CHANGE \`updated_at\` \`updated_at\` datetime(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)`);
        await queryRunner.query(`ALTER TABLE \`offboarding_template_tasks\` CHANGE \`created_at\` \`created_at\` datetime(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3)`);
        await queryRunner.query(`ALTER TABLE \`offboarding_templates\` CHANGE \`updated_at\` \`updated_at\` datetime(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)`);
        await queryRunner.query(`ALTER TABLE \`offboarding_templates\` CHANGE \`created_at\` \`created_at\` datetime(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3)`);
        await queryRunner.query(`ALTER TABLE \`probation_reviews\` CHANGE \`created_at\` \`created_at\` datetime(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3)`);
        await queryRunner.query(`ALTER TABLE \`probations\` CHANGE \`updated_at\` \`updated_at\` datetime(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)`);
        await queryRunner.query(`ALTER TABLE \`probations\` CHANGE \`created_at\` \`created_at\` datetime(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3)`);
        await queryRunner.query(`ALTER TABLE \`onboarding_surveys\` CHANGE \`updated_at\` \`updated_at\` datetime(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)`);
        await queryRunner.query(`ALTER TABLE \`onboarding_surveys\` CHANGE \`created_at\` \`created_at\` datetime(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3)`);
        await queryRunner.query(`ALTER TABLE \`buddy_assignments\` CHANGE \`updated_at\` \`updated_at\` datetime(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)`);
        await queryRunner.query(`ALTER TABLE \`buddy_assignments\` CHANGE \`created_at\` \`created_at\` datetime(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3)`);
        await queryRunner.query(`ALTER TABLE \`provisioning_items\` CHANGE \`updated_at\` \`updated_at\` datetime(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)`);
        await queryRunner.query(`ALTER TABLE \`provisioning_items\` CHANGE \`created_at\` \`created_at\` datetime(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3)`);
        await queryRunner.query(`ALTER TABLE \`onboarding_documents\` CHANGE \`updated_at\` \`updated_at\` datetime(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)`);
        await queryRunner.query(`ALTER TABLE \`onboarding_documents\` CHANGE \`created_at\` \`created_at\` datetime(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3)`);
        await queryRunner.query(`ALTER TABLE \`onboarding_tasks\` CHANGE \`updated_at\` \`updated_at\` datetime(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)`);
        await queryRunner.query(`ALTER TABLE \`onboarding_tasks\` CHANGE \`created_at\` \`created_at\` datetime(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3)`);
        await queryRunner.query(`ALTER TABLE \`onboarding_cases\` CHANGE \`updated_at\` \`updated_at\` datetime(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)`);
        await queryRunner.query(`ALTER TABLE \`onboarding_cases\` CHANGE \`created_at\` \`created_at\` datetime(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3)`);
        await queryRunner.query(`ALTER TABLE \`onboarding_template_tasks\` CHANGE \`updated_at\` \`updated_at\` datetime(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)`);
        await queryRunner.query(`ALTER TABLE \`onboarding_template_tasks\` CHANGE \`created_at\` \`created_at\` datetime(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3)`);
        await queryRunner.query(`ALTER TABLE \`onboarding_templates\` CHANGE \`updated_at\` \`updated_at\` datetime(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)`);
        await queryRunner.query(`ALTER TABLE \`onboarding_templates\` CHANGE \`created_at\` \`created_at\` datetime(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3)`);
        await queryRunner.query(`ALTER TABLE \`tenant_api_keys\` CHANGE \`updated_at\` \`updated_at\` datetime(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)`);
        await queryRunner.query(`ALTER TABLE \`tenant_api_keys\` CHANGE \`created_at\` \`created_at\` datetime(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3)`);
        await queryRunner.query(`ALTER TABLE \`recruitment_tasks\` CHANGE \`updated_at\` \`updated_at\` datetime(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)`);
        await queryRunner.query(`ALTER TABLE \`recruitment_tasks\` CHANGE \`created_at\` \`created_at\` datetime(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3)`);
        await queryRunner.query(`ALTER TABLE \`job_applications\` CHANGE \`updated_at\` \`updated_at\` datetime(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)`);
        await queryRunner.query(`ALTER TABLE \`job_applications\` CHANGE \`created_at\` \`created_at\` datetime(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3)`);
        await queryRunner.query(`ALTER TABLE \`job_postings\` CHANGE \`updated_at\` \`updated_at\` datetime(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)`);
        await queryRunner.query(`ALTER TABLE \`job_postings\` CHANGE \`created_at\` \`created_at\` datetime(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3)`);
        await queryRunner.query(`ALTER TABLE \`holidays\` CHANGE \`updated_at\` \`updated_at\` datetime(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)`);
        await queryRunner.query(`ALTER TABLE \`holidays\` CHANGE \`created_at\` \`created_at\` datetime(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3)`);
        await queryRunner.query(`ALTER TABLE \`attendance_requests\` CHANGE \`updated_at\` \`updated_at\` datetime(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)`);
        await queryRunner.query(`ALTER TABLE \`attendance_requests\` CHANGE \`created_at\` \`created_at\` datetime(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3)`);
        await queryRunner.query(`ALTER TABLE \`leaves\` CHANGE \`updated_at\` \`updated_at\` datetime(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)`);
        await queryRunner.query(`ALTER TABLE \`leaves\` CHANGE \`created_at\` \`created_at\` datetime(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3)`);
        await queryRunner.query(`ALTER TABLE \`attendances\` CHANGE \`updated_at\` \`updated_at\` datetime(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)`);
        await queryRunner.query(`ALTER TABLE \`attendances\` CHANGE \`created_at\` \`created_at\` datetime(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3)`);
        await queryRunner.query(`ALTER TABLE \`attendance_breaks\` CHANGE \`updated_at\` \`updated_at\` datetime(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)`);
        await queryRunner.query(`ALTER TABLE \`attendance_breaks\` CHANGE \`created_at\` \`created_at\` datetime(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3)`);
        await queryRunner.query(`ALTER TABLE \`educations\` CHANGE \`updated_at\` \`updated_at\` datetime(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)`);
        await queryRunner.query(`ALTER TABLE \`educations\` CHANGE \`created_at\` \`created_at\` datetime(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3)`);
        await queryRunner.query(`ALTER TABLE \`work_experiences\` CHANGE \`updated_at\` \`updated_at\` datetime(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)`);
        await queryRunner.query(`ALTER TABLE \`work_experiences\` CHANGE \`created_at\` \`created_at\` datetime(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3)`);
        await queryRunner.query(`ALTER TABLE \`members\` CHANGE \`updated_at\` \`updated_at\` datetime(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)`);
        await queryRunner.query(`ALTER TABLE \`members\` CHANGE \`created_at\` \`created_at\` datetime(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3)`);
        await queryRunner.query(`ALTER TABLE \`notices\` CHANGE \`updated_at\` \`updated_at\` datetime(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)`);
        await queryRunner.query(`ALTER TABLE \`notices\` CHANGE \`created_at\` \`created_at\` datetime(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3)`);
        await queryRunner.query(`ALTER TABLE \`events\` CHANGE \`updated_at\` \`updated_at\` datetime(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)`);
        await queryRunner.query(`ALTER TABLE \`events\` CHANGE \`created_at\` \`created_at\` datetime(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3)`);
        await queryRunner.query(`ALTER TABLE \`hiring_sources\` CHANGE \`updated_at\` \`updated_at\` datetime(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)`);
        await queryRunner.query(`ALTER TABLE \`hiring_sources\` CHANGE \`created_at\` \`created_at\` datetime(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3)`);
        await queryRunner.query(`ALTER TABLE \`employement_types\` CHANGE \`updated_at\` \`updated_at\` datetime(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)`);
        await queryRunner.query(`ALTER TABLE \`employement_types\` CHANGE \`created_at\` \`created_at\` datetime(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3)`);
        await queryRunner.query(`ALTER TABLE \`locations\` CHANGE \`updated_at\` \`updated_at\` datetime(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)`);
        await queryRunner.query(`ALTER TABLE \`locations\` CHANGE \`created_at\` \`created_at\` datetime(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3)`);
        await queryRunner.query(`ALTER TABLE \`designations\` CHANGE \`updated_at\` \`updated_at\` datetime(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)`);
        await queryRunner.query(`ALTER TABLE \`designations\` CHANGE \`created_at\` \`created_at\` datetime(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3)`);
        await queryRunner.query(`ALTER TABLE \`departments\` CHANGE \`updated_at\` \`updated_at\` datetime(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)`);
        await queryRunner.query(`ALTER TABLE \`departments\` CHANGE \`created_at\` \`created_at\` datetime(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3)`);
        await queryRunner.query(`ALTER TABLE \`leave_policy\` CHANGE \`updated_at\` \`updated_at\` datetime(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)`);
        await queryRunner.query(`ALTER TABLE \`leave_policy\` CHANGE \`created_at\` \`created_at\` datetime(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3)`);
        await queryRunner.query(`ALTER TABLE \`working_schedule\` CHANGE \`updated_at\` \`updated_at\` datetime(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)`);
        await queryRunner.query(`ALTER TABLE \`working_schedule\` CHANGE \`created_at\` \`created_at\` datetime(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3)`);
        await queryRunner.query(`ALTER TABLE \`company\` CHANGE \`updated_at\` \`updated_at\` datetime(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)`);
        await queryRunner.query(`ALTER TABLE \`company\` CHANGE \`created_at\` \`created_at\` datetime(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3)`);
        await queryRunner.query(`ALTER TABLE \`owner\` CHANGE \`updated_at\` \`updated_at\` datetime(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)`);
        await queryRunner.query(`ALTER TABLE \`owner\` CHANGE \`created_at\` \`created_at\` datetime(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3)`);
        await queryRunner.query(`ALTER TABLE \`onboarding_templates\` DROP COLUMN \`is_default\``);
        await queryRunner.query(`CREATE UNIQUE INDEX \`IDX_e2591ca208fbc53b3e82b9f28c\` ON \`final_settlements\` (\`offboarding_case_id\`)`);
    }

}
