"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.NewDatabaseConnection1786248582561 = void 0;
class NewDatabaseConnection1786248582561 {
    constructor() {
        this.name = 'NewDatabaseConnection1786248582561';
    }
    async up(queryRunner) {
        try {
            await queryRunner.query(`ALTER TABLE \`final_settlements\` DROP FOREIGN KEY \`FK_final_settlements_case\``);
        }
        catch (e) { }
        try {
            await queryRunner.query(`DROP INDEX \`FK_members_access_role\` ON \`members\``);
        }
        catch (e) { }
        try {
            await queryRunner.query(`DROP INDEX \`IDX_2c57d7f989049e0b4e2b5986ee\` ON \`attendance_requests\``);
        }
        catch (e) { }
        try {
            await queryRunner.query(`DROP INDEX \`IDX_final_settlements_case\` ON \`final_settlements\``);
        }
        catch (e) { }
        try {
            await queryRunner.query(`DROP INDEX \`IDX_final_settlements_owner\` ON \`final_settlements\``);
        }
        catch (e) { }
        try {
            await queryRunner.query(`CREATE TABLE IF NOT EXISTS \`onboarding_templates\` (\`id\` varchar(36) NOT NULL, \`title\` varchar(191) NOT NULL, \`description\` text NULL, \`is_active\` tinyint NOT NULL DEFAULT 1, \`owner_id\` varchar(191) NOT NULL, \`created_at\` datetime(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3), \`updated_at\` datetime(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3), INDEX \`IDX_a9efa38d194edd3906aec647a6\` (\`owner_id\`), PRIMARY KEY (\`id\`)) ENGINE=InnoDB`);
        }
        catch (e) { }
        try {
            await queryRunner.query(`CREATE TABLE IF NOT EXISTS \`onboarding_template_tasks\` (\`id\` varchar(36) NOT NULL, \`template_id\` varchar(191) NOT NULL, \`title\` varchar(191) NOT NULL, \`description\` text NULL, \`owner_type\` enum ('hr', 'it', 'manager', 'employee', 'finance') NOT NULL DEFAULT 'hr', \`priority\` enum ('low', 'medium', 'high', 'critical') NOT NULL DEFAULT 'medium', \`relative_due_days\` int NOT NULL DEFAULT '7', \`order_index\` int NOT NULL DEFAULT '0', \`created_at\` datetime(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3), \`updated_at\` datetime(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3), INDEX \`IDX_8ca9e8e55eceacbed95e531bb9\` (\`template_id\`), PRIMARY KEY (\`id\`)) ENGINE=InnoDB`);
        }
        catch (e) { }
        try {
            await queryRunner.query(`CREATE TABLE IF NOT EXISTS \`onboarding_cases\` (\`id\` varchar(36) NOT NULL, \`member_id\` varchar(191) NOT NULL, \`job_application_id\` varchar(191) NULL, \`template_id\` varchar(191) NULL, \`status\` enum ('pending', 'in_progress', 'completed', 'cancelled') NOT NULL DEFAULT 'pending', \`start_date\` datetime NULL, \`target_completion_date\` datetime NULL, \`completed_at\` datetime NULL, \`notes\` text NULL, \`owner_id\` varchar(191) NOT NULL, \`created_at\` datetime(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3), \`updated_at\` datetime(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3), INDEX \`IDX_e3e12eb1b5068430a89db9a375\` (\`status\`), INDEX \`IDX_4abc2ff047aae8b9ba650f3cc3\` (\`member_id\`), INDEX \`IDX_00e60095115031457c7acdee40\` (\`owner_id\`), PRIMARY KEY (\`id\`)) ENGINE=InnoDB`);
        }
        catch (e) { }
        try {
            await queryRunner.query(`CREATE TABLE IF NOT EXISTS \`onboarding_tasks\` (\`id\` varchar(36) NOT NULL, \`onboarding_case_id\` varchar(191) NOT NULL, \`title\` varchar(191) NOT NULL, \`description\` text NULL, \`owner_type\` enum ('hr', 'it', 'manager', 'employee', 'finance') NOT NULL DEFAULT 'hr', \`assigned_member_id\` varchar(191) NULL, \`due_date\` datetime NULL, \`priority\` enum ('low', 'medium', 'high', 'critical') NOT NULL DEFAULT 'medium', \`status\` enum ('pending', 'in_progress', 'completed', 'skipped') NOT NULL DEFAULT 'pending', \`completed_at\` datetime NULL, \`completed_by_id\` varchar(191) NULL, \`notes\` text NULL, \`order_index\` int NOT NULL DEFAULT '0', \`created_at\` datetime(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3), \`updated_at\` datetime(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3), INDEX \`IDX_3d058af054f905370c7d8e2f3d\` (\`status\`), INDEX \`IDX_59edca808705a06ec343089a57\` (\`onboarding_case_id\`), PRIMARY KEY (\`id\`)) ENGINE=InnoDB`);
        }
        catch (e) { }
        try {
            await queryRunner.query(`CREATE TABLE IF NOT EXISTS \`onboarding_documents\` (\`id\` varchar(36) NOT NULL, \`onboarding_case_id\` varchar(191) NOT NULL, \`title\` varchar(191) NOT NULL, \`document_type\` varchar(191) NOT NULL DEFAULT 'contract', \`file_url\` varchar(500) NULL, \`is_required\` tinyint NOT NULL DEFAULT 1, \`status\` enum ('pending', 'signed', 'rejected') NOT NULL DEFAULT 'pending', \`signed_at\` datetime NULL, \`signed_by_id\` varchar(191) NULL, \`signature_metadata\` json NULL, \`notes\` text NULL, \`created_at\` datetime(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3), \`updated_at\` datetime(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3), INDEX \`IDX_baa32850a67b7b7e7d4ac6eaf8\` (\`onboarding_case_id\`), PRIMARY KEY (\`id\`)) ENGINE=InnoDB`);
        }
        catch (e) { }
        try {
            await queryRunner.query(`CREATE TABLE IF NOT EXISTS \`provisioning_items\` (\`id\` varchar(36) NOT NULL, \`onboarding_case_id\` varchar(191) NOT NULL, \`item_name\` varchar(191) NOT NULL, \`item_type\` varchar(191) NOT NULL DEFAULT 'hardware', \`description\` text NULL, \`owner_type\` enum ('hr', 'it', 'manager', 'employee', 'finance') NOT NULL DEFAULT 'it', \`assigned_member_id\` varchar(191) NULL, \`status\` enum ('pending', 'requested', 'assigned', 'provisioned', 'confirmed', 'rejected') NOT NULL DEFAULT 'pending', \`serial_number\` varchar(191) NULL, \`provisioned_at\` datetime NULL, \`confirmed_at\` datetime NULL, \`notes\` text NULL, \`created_at\` datetime(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3), \`updated_at\` datetime(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3), INDEX \`IDX_a3227448bb9a6f79fa6fc3ff6b\` (\`onboarding_case_id\`), PRIMARY KEY (\`id\`)) ENGINE=InnoDB`);
        }
        catch (e) { }
        try {
            await queryRunner.query(`CREATE TABLE IF NOT EXISTS \`buddy_assignments\` (\`id\` varchar(36) NOT NULL, \`onboarding_case_id\` varchar(191) NOT NULL, \`member_id\` varchar(191) NOT NULL, \`buddy_member_id\` varchar(191) NOT NULL, \`assigned_by_id\` varchar(191) NULL, \`start_date\` datetime NULL, \`end_date\` datetime NULL, \`status\` varchar(50) NOT NULL DEFAULT 'active', \`notes\` text NULL, \`created_at\` datetime(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3), \`updated_at\` datetime(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3), INDEX \`IDX_67b393cfc41ff53f4e81f5d544\` (\`member_id\`), INDEX \`IDX_75bc1d3f5297954662ce1e75f5\` (\`onboarding_case_id\`), PRIMARY KEY (\`id\`)) ENGINE=InnoDB`);
        }
        catch (e) { }
        try {
            await queryRunner.query(`CREATE TABLE IF NOT EXISTS \`onboarding_surveys\` (\`id\` varchar(36) NOT NULL, \`onboarding_case_id\` varchar(191) NOT NULL, \`member_id\` varchar(191) NOT NULL, \`title\` varchar(191) NOT NULL, \`interval_days\` int NOT NULL DEFAULT '30', \`status\` varchar(50) NOT NULL DEFAULT 'scheduled', \`sent_at\` datetime NULL, \`completed_at\` datetime NULL, \`responses\` json NULL, \`notes\` text NULL, \`created_at\` datetime(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3), \`updated_at\` datetime(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3), INDEX \`IDX_57fee15257cadb2bb4c007c3aa\` (\`member_id\`), INDEX \`IDX_35abcd9e6f77c21dbf680f9007\` (\`onboarding_case_id\`), PRIMARY KEY (\`id\`)) ENGINE=InnoDB`);
        }
        catch (e) { }
        try {
            await queryRunner.query(`CREATE TABLE IF NOT EXISTS \`probations\` (\`id\` varchar(36) NOT NULL, \`member_id\` varchar(191) NOT NULL, \`onboarding_case_id\` varchar(191) NULL, \`start_date\` datetime NOT NULL, \`duration_months\` int NOT NULL DEFAULT '3', \`calculated_end_date\` datetime NOT NULL, \`current_end_date\` datetime NOT NULL, \`status\` enum ('pending', 'under_review', 'passed', 'extended', 'failed') NOT NULL DEFAULT 'pending', \`manager_id\` varchar(191) NULL, \`review_due_date\` datetime NULL, \`reviewed_at\` datetime NULL, \`final_outcome\` enum ('pass', 'extend', 'fail') NULL, \`notes\` text NULL, \`owner_id\` varchar(191) NOT NULL, \`created_at\` datetime(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3), \`updated_at\` datetime(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3), INDEX \`IDX_1a3abc6c149ca2c0dae63098cd\` (\`status\`), INDEX \`IDX_4dca6f18819d45cfa75061a3a6\` (\`member_id\`), INDEX \`IDX_80859ab95868637faa738dd871\` (\`owner_id\`), PRIMARY KEY (\`id\`)) ENGINE=InnoDB`);
        }
        catch (e) { }
        try {
            await queryRunner.query(`CREATE TABLE IF NOT EXISTS \`probation_reviews\` (\`id\` varchar(36) NOT NULL, \`probation_id\` varchar(191) NOT NULL, \`previous_end_date\` datetime NOT NULL, \`extension_months\` int NOT NULL DEFAULT '0', \`new_end_date\` datetime NOT NULL, \`review_date\` datetime NOT NULL, \`reviewer_id\` varchar(191) NULL, \`outcome\` enum ('pass', 'extend', 'fail') NOT NULL DEFAULT 'extend', \`comments\` text NULL, \`created_at\` datetime(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3), INDEX \`IDX_4599b4482b1fc3432f5555f226\` (\`probation_id\`), PRIMARY KEY (\`id\`)) ENGINE=InnoDB`);
        }
        catch (e) { }
        try {
            await queryRunner.query(`CREATE TABLE IF NOT EXISTS \`offboarding_templates\` (\`id\` varchar(36) NOT NULL, \`title\` varchar(191) NOT NULL, \`description\` text NULL, \`is_active\` tinyint NOT NULL DEFAULT 1, \`owner_id\` varchar(191) NOT NULL, \`created_at\` datetime(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3), \`updated_at\` datetime(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3), INDEX \`IDX_e1e65529541600e15a46c99d53\` (\`owner_id\`), PRIMARY KEY (\`id\`)) ENGINE=InnoDB`);
        }
        catch (e) { }
        try {
            await queryRunner.query(`CREATE TABLE IF NOT EXISTS \`offboarding_template_tasks\` (\`id\` varchar(36) NOT NULL, \`template_id\` varchar(191) NOT NULL, \`title\` varchar(191) NOT NULL, \`description\` text NULL, \`owner_type\` enum ('hr', 'it', 'manager', 'employee', 'finance') NOT NULL DEFAULT 'hr', \`priority\` enum ('low', 'medium', 'high', 'critical') NOT NULL DEFAULT 'medium', \`relative_due_days\` int NOT NULL DEFAULT '7', \`order_index\` int NOT NULL DEFAULT '0', \`created_at\` datetime(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3), \`updated_at\` datetime(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3), INDEX \`IDX_8d49ac15e57f63afbb5b013af0\` (\`template_id\`), PRIMARY KEY (\`id\`)) ENGINE=InnoDB`);
        }
        catch (e) { }
        try {
            await queryRunner.query(`CREATE TABLE IF NOT EXISTS \`offboarding_cases\` (\`id\` varchar(36) NOT NULL, \`member_id\` varchar(191) NOT NULL, \`template_id\` varchar(191) NULL, \`initiated_by_id\` varchar(191) NULL, \`reason\` enum ('resignation', 'termination', 'retirement', 'contract_end', 'other') NOT NULL DEFAULT 'resignation', \`last_working_date\` datetime NOT NULL, \`notice_period_days\` int NOT NULL DEFAULT '30', \`status\` enum ('initiated', 'in_progress', 'pending_clearance', 'pending_settlement', 'ready_to_close', 'completed', 'cancelled') NOT NULL DEFAULT 'initiated', \`completed_at\` datetime NULL, \`access_deactivated_at\` datetime NULL, \`notes\` text NULL, \`owner_id\` varchar(191) NOT NULL, \`created_at\` datetime(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3), \`updated_at\` datetime(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3), INDEX \`IDX_7c57ed74c62e1c33a01e439763\` (\`status\`), INDEX \`IDX_c1952ebec53e72e335f5cf4c73\` (\`member_id\`), INDEX \`IDX_3a79261d7583a3c33b31b44a82\` (\`owner_id\`), PRIMARY KEY (\`id\`)) ENGINE=InnoDB`);
        }
        catch (e) { }
        try {
            await queryRunner.query(`CREATE TABLE IF NOT EXISTS \`offboarding_tasks\` (\`id\` varchar(36) NOT NULL, \`offboarding_case_id\` varchar(191) NOT NULL, \`title\` varchar(191) NOT NULL, \`description\` text NULL, \`owner_type\` enum ('hr', 'it', 'manager', 'employee', 'finance') NOT NULL DEFAULT 'hr', \`assigned_member_id\` varchar(191) NULL, \`due_date\` datetime NULL, \`priority\` enum ('low', 'medium', 'high', 'critical') NOT NULL DEFAULT 'medium', \`status\` enum ('pending', 'in_progress', 'completed', 'skipped') NOT NULL DEFAULT 'pending', \`completed_at\` datetime NULL, \`completed_by_id\` varchar(191) NULL, \`notes\` text NULL, \`order_index\` int NOT NULL DEFAULT '0', \`created_at\` datetime(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3), \`updated_at\` datetime(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3), INDEX \`IDX_643881fd84c6bced08242e9b66\` (\`status\`), INDEX \`IDX_6f7cf125dbb21bb87fe74641ad\` (\`offboarding_case_id\`), PRIMARY KEY (\`id\`)) ENGINE=InnoDB`);
        }
        catch (e) { }
        try {
            await queryRunner.query(`CREATE TABLE IF NOT EXISTS \`equipment_returns\` (\`id\` varchar(36) NOT NULL, \`offboarding_case_id\` varchar(191) NOT NULL, \`item_name\` varchar(191) NOT NULL, \`item_type\` varchar(191) NOT NULL DEFAULT 'hardware', \`serial_number\` varchar(191) NULL, \`condition\` varchar(50) NOT NULL DEFAULT 'good', \`returned_at\` datetime NULL, \`received_by_id\` varchar(191) NULL, \`notes\` text NULL, \`created_at\` datetime(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3), \`updated_at\` datetime(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3), INDEX \`IDX_65c50c97848a1ae4c8c184c25a\` (\`offboarding_case_id\`), PRIMARY KEY (\`id\`)) ENGINE=InnoDB`);
        }
        catch (e) { }
        try {
            await queryRunner.query(`CREATE TABLE IF NOT EXISTS \`exit_interview_templates\` (\`id\` varchar(36) NOT NULL, \`title\` varchar(191) NOT NULL, \`description\` text NULL, \`is_active\` tinyint NOT NULL DEFAULT 1, \`questions\` json NULL, \`owner_id\` varchar(191) NOT NULL, \`created_at\` datetime(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3), \`updated_at\` datetime(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3), INDEX \`IDX_ee7cb714a3d818c1dec3cd02b4\` (\`owner_id\`), PRIMARY KEY (\`id\`)) ENGINE=InnoDB`);
        }
        catch (e) { }
        try {
            await queryRunner.query(`CREATE TABLE IF NOT EXISTS \`exit_interviews\` (\`id\` varchar(36) NOT NULL, \`offboarding_case_id\` varchar(191) NOT NULL, \`member_id\` varchar(191) NOT NULL, \`template_id\` varchar(191) NULL, \`status\` varchar(50) NOT NULL DEFAULT 'pending', \`submitted_at\` datetime NULL, \`responses\` json NULL, \`notes\` text NULL, \`created_at\` datetime(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3), \`updated_at\` datetime(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3), INDEX \`IDX_c81b8a0bb7d3a6009a8011f47e\` (\`member_id\`), INDEX \`IDX_d9ddf3f4afb54d27024b2272b2\` (\`offboarding_case_id\`), UNIQUE INDEX \`REL_d9ddf3f4afb54d27024b2272b2\` (\`offboarding_case_id\`), PRIMARY KEY (\`id\`)) ENGINE=InnoDB`);
        }
        catch (e) { }
        try {
            await queryRunner.query(`CREATE TABLE IF NOT EXISTS \`final_settlement_items\` (\`id\` varchar(36) NOT NULL, \`settlement_id\` varchar(191) NOT NULL, \`item_name\` varchar(191) NOT NULL, \`item_type\` varchar(50) NOT NULL DEFAULT 'earning', \`amount\` decimal(12,2) NOT NULL DEFAULT '0.00', \`description\` text NULL, \`created_at\` datetime(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3), INDEX \`IDX_4c9e815bfbb9ca4259cf90f141\` (\`settlement_id\`), PRIMARY KEY (\`id\`)) ENGINE=InnoDB`);
        }
        catch (e) { }
        try {
            await queryRunner.query(`ALTER TABLE \`designations\` DROP COLUMN \`probation_days\``);
        }
        catch (e) { }
        try {
            await queryRunner.query(`ALTER TABLE \`final_settlements\` DROP COLUMN \`case_id\``);
        }
        catch (e) { }
        try {
            await queryRunner.query(`ALTER TABLE \`final_settlements\` DROP COLUMN \`final_pay_amount\``);
        }
        catch (e) { }
        try {
            await queryRunner.query(`ALTER TABLE \`final_settlements\` DROP COLUMN \`leave_encashment\``);
        }
        catch (e) { }
        try {
            await queryRunner.query(`ALTER TABLE \`final_settlements\` DROP COLUMN \`provident_fund\``);
        }
        catch (e) { }
        try {
            await queryRunner.query(`ALTER TABLE \`final_settlements\` DROP COLUMN \`gratuity\``);
        }
        catch (e) { }
        try {
            await queryRunner.query(`ALTER TABLE \`final_settlements\` DROP COLUMN \`total_amount\``);
        }
        catch (e) { }
        try {
            await queryRunner.query(`ALTER TABLE \`final_settlements\` DROP COLUMN \`calculation_details\``);
        }
        catch (e) { }
        try {
            await queryRunner.query(`ALTER TABLE \`final_settlements\` DROP COLUMN \`confirmed_by\``);
        }
        catch (e) { }
        try {
            await queryRunner.query(`ALTER TABLE \`final_settlements\` DROP COLUMN \`confirmed_at\``);
        }
        catch (e) { }
        try {
            await queryRunner.query(`ALTER TABLE \`final_settlements\` ADD \`offboarding_case_id\` varchar(191) NOT NULL`);
        }
        catch (e) { }
        try {
            await queryRunner.query(`ALTER TABLE \`final_settlements\` ADD UNIQUE INDEX \`IDX_e2591ca208fbc53b3e82b9f28c\` (\`offboarding_case_id\`)`);
        }
        catch (e) { }
        try {
            await queryRunner.query(`ALTER TABLE \`final_settlements\` ADD \`member_id\` varchar(191) NOT NULL`);
        }
        catch (e) { }
        try {
            await queryRunner.query(`ALTER TABLE \`final_settlements\` ADD \`calculation_date\` datetime NULL`);
        }
        catch (e) { }
        try {
            await queryRunner.query(`ALTER TABLE \`final_settlements\` ADD \`approved_at\` datetime NULL`);
        }
        catch (e) { }
        try {
            await queryRunner.query(`ALTER TABLE \`final_settlements\` ADD \`approved_by_id\` varchar(191) NULL`);
        }
        catch (e) { }
        try {
            await queryRunner.query(`ALTER TABLE \`final_settlements\` ADD \`gross_settlement\` decimal(12,2) NOT NULL DEFAULT '0.00'`);
        }
        catch (e) { }
        try {
            await queryRunner.query(`ALTER TABLE \`final_settlements\` ADD \`total_deductions\` decimal(12,2) NOT NULL DEFAULT '0.00'`);
        }
        catch (e) { }
        try {
            await queryRunner.query(`ALTER TABLE \`final_settlements\` ADD \`net_settlement\` decimal(12,2) NOT NULL DEFAULT '0.00'`);
        }
        catch (e) { }
        try {
            await queryRunner.query(`ALTER TABLE \`final_settlements\` ADD \`notes\` text NULL`);
        }
        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 \`notifications\` CHANGE \`type\` \`type\` enum ('HOLIDAY', 'NOTICE', 'LEAVE', 'ATTENDANCE', 'RECRUITMENT') NOT NULL`);
        }
        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 \`final_settlements\` CHANGE \`status\` \`status\` enum ('draft', 'calculated', 'under_review', 'approved', 'included_in_payroll', 'paid', 'cancelled') NOT NULL DEFAULT 'draft'`);
        }
        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(`CREATE INDEX \`IDX_2c57d7f989049e0b4e2b5986ee\` ON \`attendance_requests\` (\`member_id\`, \`request_date\`, \`status\`)`);
        }
        catch (e) { }
        try {
            await queryRunner.query(`CREATE INDEX \`IDX_026c9fa9f4b4785c016c3850f7\` ON \`final_settlements\` (\`status\`)`);
        }
        catch (e) { }
        try {
            await queryRunner.query(`CREATE INDEX \`IDX_e2f7c6c39b76a619e54d3c16e9\` ON \`final_settlements\` (\`member_id\`)`);
        }
        catch (e) { }
        try {
            await queryRunner.query(`CREATE INDEX \`IDX_209e67b31458270c98fa013e35\` ON \`final_settlements\` (\`owner_id\`)`);
        }
        catch (e) { }
        try {
            await queryRunner.query(`CREATE UNIQUE INDEX \`REL_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_55d5e9147b7445bc36b5af3bd51\` FOREIGN KEY (\`approver_owner_id\`) REFERENCES \`owner\`(\`id\`) ON DELETE SET NULL ON UPDATE NO ACTION`);
        }
        catch (e) { }
        try {
            await queryRunner.query(`ALTER TABLE \`attendance_requests\` ADD CONSTRAINT \`FK_c4a9645c98edd874dcc3462adcd\` FOREIGN KEY (\`approver_member_id\`) REFERENCES \`members\`(\`id\`) ON DELETE SET NULL 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_template_tasks\` ADD CONSTRAINT \`FK_8ca9e8e55eceacbed95e531bb92\` FOREIGN KEY (\`template_id\`) REFERENCES \`onboarding_templates\`(\`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_59edca808705a06ec343089a579\` FOREIGN KEY (\`onboarding_case_id\`) REFERENCES \`onboarding_cases\`(\`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 \`onboarding_documents\` ADD CONSTRAINT \`FK_baa32850a67b7b7e7d4ac6eaf88\` FOREIGN KEY (\`onboarding_case_id\`) REFERENCES \`onboarding_cases\`(\`id\`) ON DELETE CASCADE ON UPDATE NO ACTION`);
        }
        catch (e) { }
        try {
            await queryRunner.query(`ALTER TABLE \`provisioning_items\` ADD CONSTRAINT \`FK_a3227448bb9a6f79fa6fc3ff6bc\` FOREIGN KEY (\`onboarding_case_id\`) REFERENCES \`onboarding_cases\`(\`id\`) ON DELETE CASCADE ON UPDATE NO ACTION`);
        }
        catch (e) { }
        try {
            await queryRunner.query(`ALTER TABLE \`buddy_assignments\` ADD CONSTRAINT \`FK_75bc1d3f5297954662ce1e75f58\` FOREIGN KEY (\`onboarding_case_id\`) REFERENCES \`onboarding_cases\`(\`id\`) ON DELETE CASCADE 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_35abcd9e6f77c21dbf680f90073\` FOREIGN KEY (\`onboarding_case_id\`) REFERENCES \`onboarding_cases\`(\`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 \`probation_reviews\` ADD CONSTRAINT \`FK_4599b4482b1fc3432f5555f2267\` FOREIGN KEY (\`probation_id\`) REFERENCES \`probations\`(\`id\`) ON DELETE CASCADE ON UPDATE NO ACTION`);
        }
        catch (e) { }
        try {
            await queryRunner.query(`ALTER TABLE \`offboarding_template_tasks\` ADD CONSTRAINT \`FK_8d49ac15e57f63afbb5b013af03\` FOREIGN KEY (\`template_id\`) REFERENCES \`offboarding_templates\`(\`id\`) ON DELETE CASCADE 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_6f7cf125dbb21bb87fe74641ad9\` FOREIGN KEY (\`offboarding_case_id\`) REFERENCES \`offboarding_cases\`(\`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 \`equipment_returns\` ADD CONSTRAINT \`FK_65c50c97848a1ae4c8c184c25a8\` FOREIGN KEY (\`offboarding_case_id\`) REFERENCES \`offboarding_cases\`(\`id\`) ON DELETE CASCADE ON UPDATE NO ACTION`);
        }
        catch (e) { }
        try {
            await queryRunner.query(`ALTER TABLE \`exit_interviews\` ADD CONSTRAINT \`FK_d9ddf3f4afb54d27024b2272b25\` FOREIGN KEY (\`offboarding_case_id\`) REFERENCES \`offboarding_cases\`(\`id\`) ON DELETE CASCADE 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_e2591ca208fbc53b3e82b9f28c1\` FOREIGN KEY (\`offboarding_case_id\`) REFERENCES \`offboarding_cases\`(\`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) { }
        try {
            await queryRunner.query(`ALTER TABLE \`final_settlement_items\` ADD CONSTRAINT \`FK_4c9e815bfbb9ca4259cf90f1418\` FOREIGN KEY (\`settlement_id\`) REFERENCES \`final_settlements\`(\`id\`) ON DELETE CASCADE ON UPDATE NO ACTION`);
        }
        catch (e) { }
    }
    async down(queryRunner) {
        await queryRunner.query(`ALTER TABLE \`final_settlement_items\` DROP FOREIGN KEY \`FK_4c9e815bfbb9ca4259cf90f1418\``);
        await queryRunner.query(`ALTER TABLE \`final_settlements\` DROP FOREIGN KEY \`FK_e2f7c6c39b76a619e54d3c16e98\``);
        await queryRunner.query(`ALTER TABLE \`final_settlements\` DROP FOREIGN KEY \`FK_e2591ca208fbc53b3e82b9f28c1\``);
        await queryRunner.query(`ALTER TABLE \`exit_interviews\` DROP FOREIGN KEY \`FK_c81b8a0bb7d3a6009a8011f47e5\``);
        await queryRunner.query(`ALTER TABLE \`exit_interviews\` DROP FOREIGN KEY \`FK_d9ddf3f4afb54d27024b2272b25\``);
        await queryRunner.query(`ALTER TABLE \`equipment_returns\` DROP FOREIGN KEY \`FK_65c50c97848a1ae4c8c184c25a8\``);
        await queryRunner.query(`ALTER TABLE \`offboarding_tasks\` DROP FOREIGN KEY \`FK_86e0b2b7658dc4c86db9e33fd98\``);
        await queryRunner.query(`ALTER TABLE \`offboarding_tasks\` DROP FOREIGN KEY \`FK_6f7cf125dbb21bb87fe74641ad9\``);
        await queryRunner.query(`ALTER TABLE \`offboarding_cases\` DROP FOREIGN KEY \`FK_c1952ebec53e72e335f5cf4c732\``);
        await queryRunner.query(`ALTER TABLE \`offboarding_template_tasks\` DROP FOREIGN KEY \`FK_8d49ac15e57f63afbb5b013af03\``);
        await queryRunner.query(`ALTER TABLE \`probation_reviews\` DROP FOREIGN KEY \`FK_4599b4482b1fc3432f5555f2267\``);
        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 \`onboarding_surveys\` DROP FOREIGN KEY \`FK_35abcd9e6f77c21dbf680f90073\``);
        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 \`buddy_assignments\` DROP FOREIGN KEY \`FK_75bc1d3f5297954662ce1e75f58\``);
        await queryRunner.query(`ALTER TABLE \`provisioning_items\` DROP FOREIGN KEY \`FK_a3227448bb9a6f79fa6fc3ff6bc\``);
        await queryRunner.query(`ALTER TABLE \`onboarding_documents\` DROP FOREIGN KEY \`FK_baa32850a67b7b7e7d4ac6eaf88\``);
        await queryRunner.query(`ALTER TABLE \`onboarding_tasks\` DROP FOREIGN KEY \`FK_ea6a60e2a2934a4ab31502af80a\``);
        await queryRunner.query(`ALTER TABLE \`onboarding_tasks\` DROP FOREIGN KEY \`FK_59edca808705a06ec343089a579\``);
        await queryRunner.query(`ALTER TABLE \`onboarding_cases\` DROP FOREIGN KEY \`FK_4abc2ff047aae8b9ba650f3cc3d\``);
        await queryRunner.query(`ALTER TABLE \`onboarding_template_tasks\` DROP FOREIGN KEY \`FK_8ca9e8e55eceacbed95e531bb92\``);
        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_c4a9645c98edd874dcc3462adcd\``);
        await queryRunner.query(`ALTER TABLE \`attendance_requests\` DROP FOREIGN KEY \`FK_55d5e9147b7445bc36b5af3bd51\``);
        await queryRunner.query(`ALTER TABLE \`attendance_requests\` DROP FOREIGN KEY \`FK_df7290b8a7336c4e176c843a631\``);
        await queryRunner.query(`DROP INDEX \`REL_e2591ca208fbc53b3e82b9f28c\` ON \`final_settlements\``);
        await queryRunner.query(`DROP INDEX \`IDX_209e67b31458270c98fa013e35\` ON \`final_settlements\``);
        await queryRunner.query(`DROP INDEX \`IDX_e2f7c6c39b76a619e54d3c16e9\` ON \`final_settlements\``);
        await queryRunner.query(`DROP INDEX \`IDX_026c9fa9f4b4785c016c3850f7\` ON \`final_settlements\``);
        await queryRunner.query(`DROP INDEX \`IDX_2c57d7f989049e0b4e2b5986ee\` ON \`attendance_requests\``);
        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 \`final_settlements\` CHANGE \`status\` \`status\` enum ('draft', 'confirmed', 'paid') NOT NULL DEFAULT 'draft'`);
        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 \`notifications\` CHANGE \`type\` \`type\` enum COLLATE "utf8mb4_general_ci" ('HOLIDAY', 'NOTICE', 'LEAVE', 'ATTENDANCE', 'RECRUITMENT', 'ONBOARDING') NOT NULL`);
        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 \`final_settlements\` DROP COLUMN \`notes\``);
        await queryRunner.query(`ALTER TABLE \`final_settlements\` DROP COLUMN \`net_settlement\``);
        await queryRunner.query(`ALTER TABLE \`final_settlements\` DROP COLUMN \`total_deductions\``);
        await queryRunner.query(`ALTER TABLE \`final_settlements\` DROP COLUMN \`gross_settlement\``);
        await queryRunner.query(`ALTER TABLE \`final_settlements\` DROP COLUMN \`approved_by_id\``);
        await queryRunner.query(`ALTER TABLE \`final_settlements\` DROP COLUMN \`approved_at\``);
        await queryRunner.query(`ALTER TABLE \`final_settlements\` DROP COLUMN \`calculation_date\``);
        await queryRunner.query(`ALTER TABLE \`final_settlements\` DROP COLUMN \`member_id\``);
        await queryRunner.query(`ALTER TABLE \`final_settlements\` DROP INDEX \`IDX_e2591ca208fbc53b3e82b9f28c\``);
        await queryRunner.query(`ALTER TABLE \`final_settlements\` DROP COLUMN \`offboarding_case_id\``);
        await queryRunner.query(`ALTER TABLE \`final_settlements\` ADD \`confirmed_at\` datetime NULL`);
        await queryRunner.query(`ALTER TABLE \`final_settlements\` ADD \`confirmed_by\` varchar(191) NULL`);
        await queryRunner.query(`ALTER TABLE \`final_settlements\` ADD \`calculation_details\` json NULL`);
        await queryRunner.query(`ALTER TABLE \`final_settlements\` ADD \`total_amount\` float NOT NULL DEFAULT '0'`);
        await queryRunner.query(`ALTER TABLE \`final_settlements\` ADD \`gratuity\` float NOT NULL DEFAULT '0'`);
        await queryRunner.query(`ALTER TABLE \`final_settlements\` ADD \`provident_fund\` float NOT NULL DEFAULT '0'`);
        await queryRunner.query(`ALTER TABLE \`final_settlements\` ADD \`leave_encashment\` float NOT NULL DEFAULT '0'`);
        await queryRunner.query(`ALTER TABLE \`final_settlements\` ADD \`final_pay_amount\` float NOT NULL DEFAULT '0'`);
        await queryRunner.query(`ALTER TABLE \`final_settlements\` ADD \`case_id\` varchar(191) NOT NULL`);
        await queryRunner.query(`ALTER TABLE \`designations\` ADD \`probation_days\` int NOT NULL DEFAULT '90'`);
        await queryRunner.query(`DROP INDEX \`IDX_4c9e815bfbb9ca4259cf90f141\` ON \`final_settlement_items\``);
        await queryRunner.query(`DROP TABLE \`final_settlement_items\``);
        await queryRunner.query(`DROP INDEX \`REL_d9ddf3f4afb54d27024b2272b2\` ON \`exit_interviews\``);
        await queryRunner.query(`DROP INDEX \`IDX_d9ddf3f4afb54d27024b2272b2\` ON \`exit_interviews\``);
        await queryRunner.query(`DROP INDEX \`IDX_c81b8a0bb7d3a6009a8011f47e\` ON \`exit_interviews\``);
        await queryRunner.query(`DROP TABLE \`exit_interviews\``);
        await queryRunner.query(`DROP INDEX \`IDX_ee7cb714a3d818c1dec3cd02b4\` ON \`exit_interview_templates\``);
        await queryRunner.query(`DROP TABLE \`exit_interview_templates\``);
        await queryRunner.query(`DROP INDEX \`IDX_65c50c97848a1ae4c8c184c25a\` ON \`equipment_returns\``);
        await queryRunner.query(`DROP TABLE \`equipment_returns\``);
        await queryRunner.query(`DROP INDEX \`IDX_6f7cf125dbb21bb87fe74641ad\` ON \`offboarding_tasks\``);
        await queryRunner.query(`DROP INDEX \`IDX_643881fd84c6bced08242e9b66\` ON \`offboarding_tasks\``);
        await queryRunner.query(`DROP TABLE \`offboarding_tasks\``);
        await queryRunner.query(`DROP INDEX \`IDX_3a79261d7583a3c33b31b44a82\` ON \`offboarding_cases\``);
        await queryRunner.query(`DROP INDEX \`IDX_c1952ebec53e72e335f5cf4c73\` ON \`offboarding_cases\``);
        await queryRunner.query(`DROP INDEX \`IDX_7c57ed74c62e1c33a01e439763\` ON \`offboarding_cases\``);
        await queryRunner.query(`DROP TABLE \`offboarding_cases\``);
        await queryRunner.query(`DROP INDEX \`IDX_8d49ac15e57f63afbb5b013af0\` ON \`offboarding_template_tasks\``);
        await queryRunner.query(`DROP TABLE \`offboarding_template_tasks\``);
        await queryRunner.query(`DROP INDEX \`IDX_e1e65529541600e15a46c99d53\` ON \`offboarding_templates\``);
        await queryRunner.query(`DROP TABLE \`offboarding_templates\``);
        await queryRunner.query(`DROP INDEX \`IDX_4599b4482b1fc3432f5555f226\` ON \`probation_reviews\``);
        await queryRunner.query(`DROP TABLE \`probation_reviews\``);
        await queryRunner.query(`DROP INDEX \`IDX_80859ab95868637faa738dd871\` ON \`probations\``);
        await queryRunner.query(`DROP INDEX \`IDX_4dca6f18819d45cfa75061a3a6\` ON \`probations\``);
        await queryRunner.query(`DROP INDEX \`IDX_1a3abc6c149ca2c0dae63098cd\` ON \`probations\``);
        await queryRunner.query(`DROP TABLE \`probations\``);
        await queryRunner.query(`DROP INDEX \`IDX_35abcd9e6f77c21dbf680f9007\` ON \`onboarding_surveys\``);
        await queryRunner.query(`DROP INDEX \`IDX_57fee15257cadb2bb4c007c3aa\` ON \`onboarding_surveys\``);
        await queryRunner.query(`DROP TABLE \`onboarding_surveys\``);
        await queryRunner.query(`DROP INDEX \`IDX_75bc1d3f5297954662ce1e75f5\` ON \`buddy_assignments\``);
        await queryRunner.query(`DROP INDEX \`IDX_67b393cfc41ff53f4e81f5d544\` ON \`buddy_assignments\``);
        await queryRunner.query(`DROP TABLE \`buddy_assignments\``);
        await queryRunner.query(`DROP INDEX \`IDX_a3227448bb9a6f79fa6fc3ff6b\` ON \`provisioning_items\``);
        await queryRunner.query(`DROP TABLE \`provisioning_items\``);
        await queryRunner.query(`DROP INDEX \`IDX_baa32850a67b7b7e7d4ac6eaf8\` ON \`onboarding_documents\``);
        await queryRunner.query(`DROP TABLE \`onboarding_documents\``);
        await queryRunner.query(`DROP INDEX \`IDX_59edca808705a06ec343089a57\` ON \`onboarding_tasks\``);
        await queryRunner.query(`DROP INDEX \`IDX_3d058af054f905370c7d8e2f3d\` ON \`onboarding_tasks\``);
        await queryRunner.query(`DROP TABLE \`onboarding_tasks\``);
        await queryRunner.query(`DROP INDEX \`IDX_00e60095115031457c7acdee40\` ON \`onboarding_cases\``);
        await queryRunner.query(`DROP INDEX \`IDX_4abc2ff047aae8b9ba650f3cc3\` ON \`onboarding_cases\``);
        await queryRunner.query(`DROP INDEX \`IDX_e3e12eb1b5068430a89db9a375\` ON \`onboarding_cases\``);
        await queryRunner.query(`DROP TABLE \`onboarding_cases\``);
        await queryRunner.query(`DROP INDEX \`IDX_8ca9e8e55eceacbed95e531bb9\` ON \`onboarding_template_tasks\``);
        await queryRunner.query(`DROP TABLE \`onboarding_template_tasks\``);
        await queryRunner.query(`DROP INDEX \`IDX_a9efa38d194edd3906aec647a6\` ON \`onboarding_templates\``);
        await queryRunner.query(`DROP TABLE \`onboarding_templates\``);
        await queryRunner.query(`CREATE INDEX \`IDX_final_settlements_owner\` ON \`final_settlements\` (\`owner_id\`)`);
        await queryRunner.query(`CREATE INDEX \`IDX_final_settlements_case\` ON \`final_settlements\` (\`case_id\`)`);
        await queryRunner.query(`CREATE INDEX \`IDX_2c57d7f989049e0b4e2b5986ee\` ON \`attendance_requests\` (\`request_date\`, \`status\`)`);
        await queryRunner.query(`CREATE INDEX \`FK_members_access_role\` ON \`members\` (\`access_role_id\`)`);
        await queryRunner.query(`ALTER TABLE \`final_settlements\` ADD CONSTRAINT \`FK_final_settlements_case\` FOREIGN KEY (\`case_id\`) REFERENCES \`offboarding_cases\`(\`id\`) ON DELETE CASCADE ON UPDATE NO ACTION`);
    }
}
exports.NewDatabaseConnection1786248582561 = NewDatabaseConnection1786248582561;
//# sourceMappingURL=1786248582561-NewDatabaseConnection.js.map