"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.NewDatabaseConnection1784656414320 = void 0;
class NewDatabaseConnection1784656414320 {
    constructor() {
        this.name = 'NewDatabaseConnection1784656414320';
    }
    async up(queryRunner) {
        try {
            await queryRunner.query(`ALTER TABLE \`company\` DROP FOREIGN KEY \`FK_0c6ea8a32565efcb512e572d61d\``);
        }
        catch (e) { }
        try {
            await queryRunner.query(`ALTER TABLE \`working_schedule\` DROP FOREIGN KEY \`FK_2814f05e73089b95f0a7e9bc58b\``);
        }
        catch (e) { }
        try {
            await queryRunner.query(`ALTER TABLE \`leave_policy\` DROP FOREIGN KEY \`FK_e8665e3b253027261a8af249452\``);
        }
        catch (e) { }
        try {
            await queryRunner.query(`ALTER TABLE \`departments\` DROP FOREIGN KEY \`FK_392bbf7a4cf28bd0cdfa69a8970\``);
        }
        catch (e) { }
        try {
            await queryRunner.query(`ALTER TABLE \`designations\` DROP FOREIGN KEY \`FK_4728de48d7d4a0323c4f581c880\``);
        }
        catch (e) { }
        try {
            await queryRunner.query(`ALTER TABLE \`locations\` DROP FOREIGN KEY \`FK_2ce5c9e8fd1c1f0945db786e308\``);
        }
        catch (e) { }
        try {
            await queryRunner.query(`ALTER TABLE \`employement_types\` DROP FOREIGN KEY \`FK_5e57334eca32b397f8cedaf04e5\``);
        }
        catch (e) { }
        try {
            await queryRunner.query(`ALTER TABLE \`hiring_sources\` DROP FOREIGN KEY \`FK_caf0a00f832838bd658f358b4d6\``);
        }
        catch (e) { }
        try {
            await queryRunner.query(`ALTER TABLE \`events\` DROP FOREIGN KEY \`FK_918130b4f882fda431503d6f4e0\``);
        }
        catch (e) { }
        try {
            await queryRunner.query(`ALTER TABLE \`notices\` DROP FOREIGN KEY \`FK_6e8f4aeffb70eff67e72c792ea3\``);
        }
        catch (e) { }
        try {
            await queryRunner.query(`ALTER TABLE \`members\` DROP FOREIGN KEY \`FK_764bf7ff2544b85cf1a8298d03e\``);
        }
        catch (e) { }
        try {
            await queryRunner.query(`ALTER TABLE \`members\` DROP FOREIGN KEY \`FK_members_access_role\``);
        }
        catch (e) { }
        try {
            await queryRunner.query(`ALTER TABLE \`work_experiences\` DROP FOREIGN KEY \`FK_38e7588937c7ca136acf8a3a3b1\``);
        }
        catch (e) { }
        try {
            await queryRunner.query(`ALTER TABLE \`work_experiences\` DROP FOREIGN KEY \`FK_53673af6504eca1ce63e62b22a6\``);
        }
        catch (e) { }
        try {
            await queryRunner.query(`ALTER TABLE \`educations\` DROP FOREIGN KEY \`FK_374560373a83e332f78def538cc\``);
        }
        catch (e) { }
        try {
            await queryRunner.query(`ALTER TABLE \`educations\` DROP FOREIGN KEY \`FK_b468e7e6265a4464c58c55b9658\``);
        }
        catch (e) { }
        try {
            await queryRunner.query(`ALTER TABLE \`attendance_breaks\` DROP FOREIGN KEY \`FK_0edf01e362647cf09a71ba4518c\``);
        }
        catch (e) { }
        try {
            await queryRunner.query(`ALTER TABLE \`attendances\` DROP FOREIGN KEY \`FK_2356832877cbc5cf26aca84e198\``);
        }
        catch (e) { }
        try {
            await queryRunner.query(`ALTER TABLE \`attendances\` DROP FOREIGN KEY \`FK_b47acfc6e4d108d060e7b9c16ad\``);
        }
        catch (e) { }
        try {
            await queryRunner.query(`ALTER TABLE \`leaves\` DROP FOREIGN KEY \`FK_4c5cbdf59315fddae800bc0d545\``);
        }
        catch (e) { }
        try {
            await queryRunner.query(`ALTER TABLE \`leaves\` DROP FOREIGN KEY \`FK_7d93f1b2454bf8b4ee0fc58c500\``);
        }
        catch (e) { }
        try {
            await queryRunner.query(`ALTER TABLE \`attendance_requests\` DROP FOREIGN KEY \`FK_attendance_requests_attendance\``);
        }
        catch (e) { }
        try {
            await queryRunner.query(`ALTER TABLE \`attendance_requests\` DROP FOREIGN KEY \`FK_attendance_requests_member\``);
        }
        catch (e) { }
        try {
            await queryRunner.query(`ALTER TABLE \`attendance_requests\` DROP FOREIGN KEY \`FK_attendance_requests_owner\``);
        }
        catch (e) { }
        try {
            await queryRunner.query(`ALTER TABLE \`holidays\` DROP FOREIGN KEY \`FK_1ef09ffe0cbce46bc8847a31d6d\``);
        }
        catch (e) { }
        try {
            await queryRunner.query(`ALTER TABLE \`access_roles\` DROP FOREIGN KEY \`FK_access_roles_owner\``);
        }
        catch (e) { }
        try {
            await queryRunner.query(`ALTER TABLE \`role_permissions\` DROP FOREIGN KEY \`FK_role_permissions_role\``);
        }
        catch (e) { }
        try {
            await queryRunner.query(`ALTER TABLE \`_noticemembers\` DROP FOREIGN KEY \`FK_notice_members_member\``);
        }
        catch (e) { }
        try {
            await queryRunner.query(`ALTER TABLE \`_noticemembers\` DROP FOREIGN KEY \`FK_notice_members_notice\``);
        }
        catch (e) { }
        try {
            await queryRunner.query(`DROP INDEX \`IDX_attendance_requests_attendance_id\` ON \`attendance_requests\``);
        }
        catch (e) { }
        try {
            await queryRunner.query(`DROP INDEX \`IDX_attendance_requests_member_date_status\` ON \`attendance_requests\``);
        }
        catch (e) { }
        try {
            await queryRunner.query(`DROP INDEX \`IDX_attendance_requests_owner_id\` ON \`attendance_requests\``);
        }
        catch (e) { }
        try {
            await queryRunner.query(`DROP INDEX \`IDX_access_roles_owner_slug\` ON \`access_roles\``);
        }
        catch (e) { }
        try {
            await queryRunner.query(`DROP INDEX \`IDX_role_permissions_role_key\` ON \`role_permissions\``);
        }
        catch (e) { }
        try {
            await queryRunner.query(`DROP INDEX \`IDX_job_postings_department\` ON \`job_postings\``);
        }
        catch (e) { }
        try {
            await queryRunner.query(`DROP INDEX \`IDX_job_postings_owner\` ON \`job_postings\``);
        }
        catch (e) { }
        try {
            await queryRunner.query(`DROP INDEX \`IDX_job_postings_owner_slug\` ON \`job_postings\``);
        }
        catch (e) { }
        try {
            await queryRunner.query(`DROP INDEX \`IDX_job_applications_job\` ON \`job_applications\``);
        }
        catch (e) { }
        try {
            await queryRunner.query(`DROP INDEX \`IDX_job_applications_owner\` ON \`job_applications\``);
        }
        catch (e) { }
        try {
            await queryRunner.query(`DROP INDEX \`IDX_job_applications_status\` ON \`job_applications\``);
        }
        catch (e) { }
        try {
            await queryRunner.query(`DROP INDEX \`IDX_recruitment_tasks_application\` ON \`recruitment_tasks\``);
        }
        catch (e) { }
        try {
            await queryRunner.query(`DROP INDEX \`IDX_recruitment_tasks_token\` ON \`recruitment_tasks\``);
        }
        catch (e) { }
        try {
            await queryRunner.query(`DROP INDEX \`IDX_tenant_api_keys_owner\` ON \`tenant_api_keys\``);
        }
        catch (e) { }
        try {
            await queryRunner.query(`DROP INDEX \`IDX_tenant_api_keys_prefix\` ON \`tenant_api_keys\``);
        }
        catch (e) { }
        try {
            await queryRunner.query(`DROP INDEX \`IDX_onboarding_plans_owner\` ON \`onboarding_plans\``);
        }
        catch (e) { }
        try {
            await queryRunner.query(`DROP INDEX \`IDX_onboarding_plan_tasks_plan\` ON \`onboarding_plan_tasks\``);
        }
        catch (e) { }
        try {
            await queryRunner.query(`DROP INDEX \`IDX_onboarding_records_application\` ON \`onboarding_records\``);
        }
        catch (e) { }
        try {
            await queryRunner.query(`DROP INDEX \`IDX_onboarding_records_member\` ON \`onboarding_records\``);
        }
        catch (e) { }
        try {
            await queryRunner.query(`DROP INDEX \`IDX_onboarding_records_owner\` ON \`onboarding_records\``);
        }
        catch (e) { }
        try {
            await queryRunner.query(`DROP INDEX \`IDX_onboarding_tasks_record\` ON \`onboarding_tasks\``);
        }
        catch (e) { }
        try {
            await queryRunner.query(`DROP INDEX \`IDX_notice_members_A\` ON \`_noticemembers\``);
        }
        catch (e) { }
        try {
            await queryRunner.query(`DROP INDEX \`IDX_notice_members_B\` ON \`_noticemembers\``);
        }
        catch (e) { }
        try {
            await queryRunner.query(`CREATE TABLE IF NOT EXISTS \`onboarding_plan_stages\` (\`id\` varchar(36) NOT NULL, \`plan_id\` varchar(191) NOT NULL, \`name\` varchar(191) NOT NULL, \`sort_order\` 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_fad73767336d9f3767945c1756\` (\`plan_id\`), PRIMARY KEY (\`id\`)) ENGINE=InnoDB`);
        }
        catch (e) { }
        try {
            await queryRunner.query(`ALTER TABLE \`onboarding_plan_tasks\` ADD \`stage_id\` varchar(191) NULL`);
        }
        catch (e) { }
        await queryRunner.query(`ALTER TABLE \`owner\` 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 \`company\` 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 \`working_schedule\` 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 \`leave_policy\` 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 \`departments\` 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 \`designations\` 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 \`locations\` 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 \`employement_types\` 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 \`hiring_sources\` 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 \`events\` 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 \`notices\` 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 \`members\` 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 \`work_experiences\` 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 \`educations\` 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 \`attendance_breaks\` 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 \`attendances\` 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 \`leaves\` 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)`);
        try {
            await queryRunner.query(`ALTER TABLE \`attendance_requests\` DROP COLUMN \`member_id\``);
        }
        catch (e) { }
        try {
            await queryRunner.query(`ALTER TABLE \`attendance_requests\` ADD \`member_id\` varchar(191) NOT NULL`);
        }
        catch (e) { }
        try {
            await queryRunner.query(`ALTER TABLE \`attendance_requests\` DROP COLUMN \`owner_id\``);
        }
        catch (e) { }
        try {
            await queryRunner.query(`ALTER TABLE \`attendance_requests\` ADD \`owner_id\` varchar(191) NOT NULL`);
        }
        catch (e) { }
        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 \`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 \`holidays\` 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)`);
        try {
            await queryRunner.query(`UPDATE \`notifications\` SET \`end_time\` = CURRENT_TIMESTAMP WHERE \`end_time\` < '1970-01-01' OR CAST(\`end_time\` AS CHAR) LIKE '0000-00-00%'`);
        }
        catch (e) { }
        try {
            await queryRunner.query(`UPDATE \`notifications\` SET \`start_time\` = CURRENT_TIMESTAMP WHERE \`start_time\` < '1970-01-01' OR CAST(\`start_time\` AS CHAR) LIKE '0000-00-00%'`);
        }
        catch (e) { }
        await queryRunner.query(`ALTER TABLE \`notifications\` CHANGE \`type\` \`type\` enum ('HOLIDAY', 'NOTICE', 'LEAVE', 'ATTENDANCE', 'RECRUITMENT', 'ONBOARDING') NOT NULL`);
        await queryRunner.query(`ALTER TABLE \`access_roles\` CHANGE \`created_at\` \`created_at\` datetime(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(6)`);
        await queryRunner.query(`ALTER TABLE \`access_roles\` CHANGE \`updated_at\` \`updated_at\` datetime(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(6) ON UPDATE CURRENT_TIMESTAMP(6)`);
        await queryRunner.query(`ALTER TABLE \`role_permissions\` CHANGE \`created_at\` \`created_at\` datetime(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(6)`);
        await queryRunner.query(`ALTER TABLE \`role_permissions\` CHANGE \`updated_at\` \`updated_at\` datetime(6) NOT NULL DEFAULT CURRENT_TIMESTAMP(6) ON UPDATE CURRENT_TIMESTAMP(6)`);
        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 \`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_applications\` CHANGE \`applied_at\` \`applied_at\` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP`);
        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_applications\` CHANGE \`updated_at\` \`updated_at\` datetime(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)`);
        try {
            await queryRunner.query(`ALTER TABLE \`recruitment_tasks\` CHANGE \`public_token\` \`public_token\` varchar(191) NOT NULL`);
        }
        catch (e) { }
        try {
            await queryRunner.query(`ALTER TABLE \`recruitment_tasks\` ADD UNIQUE INDEX \`IDX_51fd985d4f484f53a79dbc4e66\` (\`public_token\`)`);
        }
        catch (e) { }
        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 \`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 \`tenant_api_keys\` 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 \`onboarding_plans\` CHANGE \`created_at\` \`created_at\` datetime(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3)`);
        await queryRunner.query(`ALTER TABLE \`onboarding_plans\` CHANGE \`updated_at\` \`updated_at\` datetime(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)`);
        await queryRunner.query(`ALTER TABLE \`onboarding_plan_tasks\` CHANGE \`created_at\` \`created_at\` datetime(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3)`);
        await queryRunner.query(`ALTER TABLE \`onboarding_plan_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_records\` CHANGE \`created_at\` \`created_at\` datetime(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3)`);
        await queryRunner.query(`ALTER TABLE \`onboarding_records\` 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_tasks\` CHANGE \`updated_at\` \`updated_at\` datetime(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)`);
        try {
            await queryRunner.query(`CREATE INDEX \`IDX_1bc2b285faf97bd00a37a3f436\` ON \`attendance_requests\` (\`attendance_id\`)`);
        }
        catch (e) { }
        try {
            await queryRunner.query(`CREATE INDEX \`IDX_cb0102f5790efbd055116b4037\` ON \`attendance_requests\` (\`owner_id\`)`);
        }
        catch (e) { }
        try {
            await queryRunner.query(`CREATE INDEX \`IDX_df7290b8a7336c4e176c843a63\` ON \`attendance_requests\` (\`member_id\`)`);
        }
        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 UNIQUE INDEX \`IDX_9c18d618c2563fd5fa913c22d4\` ON \`access_roles\` (\`owner_id\`, \`slug\`)`);
        }
        catch (e) { }
        try {
            await queryRunner.query(`CREATE UNIQUE INDEX \`IDX_064de54701f3ac10466efa130a\` ON \`role_permissions\` (\`role_id\`, \`permission_key\`)`);
        }
        catch (e) { }
        try {
            await queryRunner.query(`CREATE INDEX \`IDX_cf838f9c48f90ad76d0f2d231e\` ON \`job_postings\` (\`department_id\`)`);
        }
        catch (e) { }
        try {
            await queryRunner.query(`CREATE INDEX \`IDX_1c15a925edd72ad7be5e24a23d\` ON \`job_postings\` (\`owner_id\`)`);
        }
        catch (e) { }
        try {
            await queryRunner.query(`CREATE UNIQUE INDEX \`IDX_08eeecc093f1bb82b062df7883\` ON \`job_postings\` (\`owner_id\`, \`slug\`)`);
        }
        catch (e) { }
        try {
            await queryRunner.query(`CREATE INDEX \`IDX_2f2d5f25a87c7f6a6ab3e5f4dc\` ON \`job_applications\` (\`status\`)`);
        }
        catch (e) { }
        try {
            await queryRunner.query(`CREATE INDEX \`IDX_1f0ed6a45088ef95236af37a5f\` ON \`job_applications\` (\`job_posting_id\`)`);
        }
        catch (e) { }
        try {
            await queryRunner.query(`CREATE INDEX \`IDX_8cb08b14a02a95de3f6e016f90\` ON \`job_applications\` (\`owner_id\`)`);
        }
        catch (e) { }
        try {
            await queryRunner.query(`CREATE INDEX \`IDX_d8cce905e6febd44f2953b0e38\` ON \`recruitment_tasks\` (\`application_id\`)`);
        }
        catch (e) { }
        try {
            await queryRunner.query(`CREATE INDEX \`IDX_61663ce74670592f96d7cc5d34\` ON \`tenant_api_keys\` (\`key_prefix\`)`);
        }
        catch (e) { }
        try {
            await queryRunner.query(`CREATE INDEX \`IDX_237cb086210e280a9b970ef829\` ON \`tenant_api_keys\` (\`owner_id\`)`);
        }
        catch (e) { }
        try {
            await queryRunner.query(`CREATE INDEX \`IDX_a01ccba12fdd69ef7b6fa757fb\` ON \`onboarding_plans\` (\`owner_id\`)`);
        }
        catch (e) { }
        try {
            await queryRunner.query(`CREATE INDEX \`IDX_23275a0023200ab03dfcaa2118\` ON \`onboarding_plan_tasks\` (\`stage_id\`)`);
        }
        catch (e) { }
        try {
            await queryRunner.query(`CREATE INDEX \`IDX_e2bc3ebb36342d3750c09a63a1\` ON \`onboarding_plan_tasks\` (\`plan_id\`)`);
        }
        catch (e) { }
        try {
            await queryRunner.query(`CREATE INDEX \`IDX_30c5e835e267ab6ecf57cd14c1\` ON \`onboarding_records\` (\`member_id\`)`);
        }
        catch (e) { }
        try {
            await queryRunner.query(`CREATE INDEX \`IDX_f9b8930c6a9014c8cdb46ad373\` ON \`onboarding_records\` (\`application_id\`)`);
        }
        catch (e) { }
        try {
            await queryRunner.query(`CREATE INDEX \`IDX_f2be31902dfec9b36bd0ad851a\` ON \`onboarding_records\` (\`owner_id\`)`);
        }
        catch (e) { }
        try {
            await queryRunner.query(`CREATE INDEX \`IDX_1f3842f02aa6185fe78cd5b5bb\` ON \`onboarding_tasks\` (\`record_id\`)`);
        }
        catch (e) { }
        try {
            await queryRunner.query(`CREATE INDEX \`IDX_437b01e78617216cee08c0fcf6\` ON \`_noticemembers\` (\`B\`)`);
        }
        catch (e) { }
        try {
            await queryRunner.query(`CREATE INDEX \`IDX_77f433ff00143df684e03dfb09\` ON \`_noticemembers\` (\`A\`)`);
        }
        catch (e) { }
        try {
            await queryRunner.query(`ALTER TABLE \`company\` ADD CONSTRAINT \`FK_0c6ea8a32565efcb512e572d61d\` FOREIGN KEY (\`owner_id\`) REFERENCES \`owner\`(\`id\`) ON DELETE RESTRICT ON UPDATE NO ACTION`);
        }
        catch (e) { }
        try {
            await queryRunner.query(`ALTER TABLE \`working_schedule\` ADD CONSTRAINT \`FK_2814f05e73089b95f0a7e9bc58b\` FOREIGN KEY (\`owner_id\`) REFERENCES \`owner\`(\`id\`) ON DELETE RESTRICT ON UPDATE NO ACTION`);
        }
        catch (e) { }
        try {
            await queryRunner.query(`ALTER TABLE \`leave_policy\` ADD CONSTRAINT \`FK_e8665e3b253027261a8af249452\` FOREIGN KEY (\`owner_id\`) REFERENCES \`owner\`(\`id\`) ON DELETE RESTRICT ON UPDATE NO ACTION`);
        }
        catch (e) { }
        try {
            await queryRunner.query(`ALTER TABLE \`departments\` ADD CONSTRAINT \`FK_392bbf7a4cf28bd0cdfa69a8970\` FOREIGN KEY (\`owner_id\`) REFERENCES \`owner\`(\`id\`) ON DELETE RESTRICT ON UPDATE NO ACTION`);
        }
        catch (e) { }
        try {
            await queryRunner.query(`ALTER TABLE \`designations\` ADD CONSTRAINT \`FK_4728de48d7d4a0323c4f581c880\` FOREIGN KEY (\`owner_id\`) REFERENCES \`owner\`(\`id\`) ON DELETE RESTRICT ON UPDATE NO ACTION`);
        }
        catch (e) { }
        try {
            await queryRunner.query(`ALTER TABLE \`locations\` ADD CONSTRAINT \`FK_2ce5c9e8fd1c1f0945db786e308\` FOREIGN KEY (\`owner_id\`) REFERENCES \`owner\`(\`id\`) ON DELETE RESTRICT ON UPDATE NO ACTION`);
        }
        catch (e) { }
        try {
            await queryRunner.query(`ALTER TABLE \`employement_types\` ADD CONSTRAINT \`FK_5e57334eca32b397f8cedaf04e5\` FOREIGN KEY (\`owner_id\`) REFERENCES \`owner\`(\`id\`) ON DELETE RESTRICT ON UPDATE NO ACTION`);
        }
        catch (e) { }
        try {
            await queryRunner.query(`ALTER TABLE \`hiring_sources\` ADD CONSTRAINT \`FK_caf0a00f832838bd658f358b4d6\` FOREIGN KEY (\`owner_id\`) REFERENCES \`owner\`(\`id\`) ON DELETE RESTRICT ON UPDATE NO ACTION`);
        }
        catch (e) { }
        try {
            await queryRunner.query(`ALTER TABLE \`events\` ADD CONSTRAINT \`FK_918130b4f882fda431503d6f4e0\` FOREIGN KEY (\`owner_id\`) REFERENCES \`owner\`(\`id\`) ON DELETE RESTRICT ON UPDATE NO ACTION`);
        }
        catch (e) { }
        try {
            await queryRunner.query(`ALTER TABLE \`notices\` ADD CONSTRAINT \`FK_6e8f4aeffb70eff67e72c792ea3\` FOREIGN KEY (\`owner_id\`) REFERENCES \`owner\`(\`id\`) ON DELETE RESTRICT ON UPDATE NO ACTION`);
        }
        catch (e) { }
        try {
            await queryRunner.query(`ALTER TABLE \`members\` ADD CONSTRAINT \`FK_764bf7ff2544b85cf1a8298d03e\` FOREIGN KEY (\`owner_id\`) REFERENCES \`owner\`(\`id\`) ON DELETE RESTRICT ON UPDATE NO ACTION`);
        }
        catch (e) { }
        try {
            await queryRunner.query(`ALTER TABLE \`work_experiences\` ADD CONSTRAINT \`FK_53673af6504eca1ce63e62b22a6\` FOREIGN KEY (\`member_id\`) REFERENCES \`members\`(\`id\`) ON DELETE RESTRICT ON UPDATE NO ACTION`);
        }
        catch (e) { }
        try {
            await queryRunner.query(`ALTER TABLE \`work_experiences\` ADD CONSTRAINT \`FK_38e7588937c7ca136acf8a3a3b1\` FOREIGN KEY (\`owner_id\`) REFERENCES \`owner\`(\`id\`) ON DELETE RESTRICT ON UPDATE NO ACTION`);
        }
        catch (e) { }
        try {
            await queryRunner.query(`ALTER TABLE \`educations\` ADD CONSTRAINT \`FK_374560373a83e332f78def538cc\` FOREIGN KEY (\`member_id\`) REFERENCES \`members\`(\`id\`) ON DELETE RESTRICT ON UPDATE NO ACTION`);
        }
        catch (e) { }
        try {
            await queryRunner.query(`ALTER TABLE \`educations\` ADD CONSTRAINT \`FK_b468e7e6265a4464c58c55b9658\` FOREIGN KEY (\`owner_id\`) REFERENCES \`owner\`(\`id\`) ON DELETE RESTRICT ON UPDATE NO ACTION`);
        }
        catch (e) { }
        try {
            await queryRunner.query(`ALTER TABLE \`attendance_breaks\` ADD CONSTRAINT \`FK_0edf01e362647cf09a71ba4518c\` FOREIGN KEY (\`owner_id\`) REFERENCES \`owner\`(\`id\`) ON DELETE RESTRICT ON UPDATE NO ACTION`);
        }
        catch (e) { }
        try {
            await queryRunner.query(`ALTER TABLE \`attendances\` ADD CONSTRAINT \`FK_2356832877cbc5cf26aca84e198\` FOREIGN KEY (\`member_id\`) REFERENCES \`members\`(\`id\`) ON DELETE RESTRICT ON UPDATE NO ACTION`);
        }
        catch (e) { }
        try {
            await queryRunner.query(`ALTER TABLE \`attendances\` ADD CONSTRAINT \`FK_b47acfc6e4d108d060e7b9c16ad\` FOREIGN KEY (\`owner_id\`) REFERENCES \`owner\`(\`id\`) ON DELETE RESTRICT ON UPDATE NO ACTION`);
        }
        catch (e) { }
        try {
            await queryRunner.query(`ALTER TABLE \`leaves\` ADD CONSTRAINT \`FK_4c5cbdf59315fddae800bc0d545\` FOREIGN KEY (\`member_id\`) REFERENCES \`members\`(\`id\`) ON DELETE RESTRICT ON UPDATE NO ACTION`);
        }
        catch (e) { }
        try {
            await queryRunner.query(`ALTER TABLE \`leaves\` ADD CONSTRAINT \`FK_7d93f1b2454bf8b4ee0fc58c500\` FOREIGN KEY (\`owner_id\`) REFERENCES \`owner\`(\`id\`) ON DELETE RESTRICT ON UPDATE NO ACTION`);
        }
        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_1bc2b285faf97bd00a37a3f436d\` FOREIGN KEY (\`attendance_id\`) REFERENCES \`attendances\`(\`id\`) ON DELETE SET NULL 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 \`holidays\` ADD CONSTRAINT \`FK_1ef09ffe0cbce46bc8847a31d6d\` FOREIGN KEY (\`owner_id\`) REFERENCES \`owner\`(\`id\`) ON DELETE RESTRICT ON UPDATE NO ACTION`);
        }
        catch (e) { }
        try {
            await queryRunner.query(`ALTER TABLE \`access_roles\` ADD CONSTRAINT \`FK_865a3eba106030747f582005591\` FOREIGN KEY (\`owner_id\`) REFERENCES \`owner\`(\`id\`) ON DELETE CASCADE ON UPDATE NO ACTION`);
        }
        catch (e) { }
        try {
            await queryRunner.query(`ALTER TABLE \`role_permissions\` ADD CONSTRAINT \`FK_178199805b901ccd220ab7740ec\` FOREIGN KEY (\`role_id\`) REFERENCES \`access_roles\`(\`id\`) ON DELETE CASCADE ON UPDATE NO ACTION`);
        }
        catch (e) { }
        try {
            await queryRunner.query(`ALTER TABLE \`job_postings\` ADD CONSTRAINT \`FK_cf838f9c48f90ad76d0f2d231e5\` FOREIGN KEY (\`department_id\`) REFERENCES \`departments\`(\`id\`) ON DELETE SET NULL ON UPDATE NO ACTION`);
        }
        catch (e) { }
        try {
            await queryRunner.query(`ALTER TABLE \`job_postings\` ADD CONSTRAINT \`FK_1c15a925edd72ad7be5e24a23d8\` FOREIGN KEY (\`owner_id\`) REFERENCES \`owner\`(\`id\`) ON DELETE RESTRICT ON UPDATE NO ACTION`);
        }
        catch (e) { }
        try {
            await queryRunner.query(`ALTER TABLE \`job_applications\` ADD CONSTRAINT \`FK_1f0ed6a45088ef95236af37a5f4\` FOREIGN KEY (\`job_posting_id\`) REFERENCES \`job_postings\`(\`id\`) ON DELETE CASCADE ON UPDATE NO ACTION`);
        }
        catch (e) { }
        try {
            await queryRunner.query(`ALTER TABLE \`job_applications\` ADD CONSTRAINT \`FK_8cb08b14a02a95de3f6e016f906\` 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 \`tenant_api_keys\` ADD CONSTRAINT \`FK_237cb086210e280a9b970ef8297\` FOREIGN KEY (\`owner_id\`) REFERENCES \`owner\`(\`id\`) ON DELETE CASCADE ON UPDATE NO ACTION`);
        }
        catch (e) { }
        try {
            await queryRunner.query(`ALTER TABLE \`onboarding_plans\` ADD CONSTRAINT \`FK_7e2e844f19adaf524beae2aff5c\` FOREIGN KEY (\`department_id\`) REFERENCES \`departments\`(\`id\`) ON DELETE SET NULL ON UPDATE NO ACTION`);
        }
        catch (e) { }
        try {
            await queryRunner.query(`ALTER TABLE \`onboarding_plans\` ADD CONSTRAINT \`FK_a01ccba12fdd69ef7b6fa757fbb\` FOREIGN KEY (\`owner_id\`) REFERENCES \`owner\`(\`id\`) ON DELETE RESTRICT ON UPDATE NO ACTION`);
        }
        catch (e) { }
        try {
            await queryRunner.query(`ALTER TABLE \`onboarding_plan_stages\` ADD CONSTRAINT \`FK_fad73767336d9f3767945c1756c\` FOREIGN KEY (\`plan_id\`) REFERENCES \`onboarding_plans\`(\`id\`) ON DELETE CASCADE ON UPDATE NO ACTION`);
        }
        catch (e) { }
        try {
            await queryRunner.query(`ALTER TABLE \`onboarding_plan_tasks\` ADD CONSTRAINT \`FK_e2bc3ebb36342d3750c09a63a11\` FOREIGN KEY (\`plan_id\`) REFERENCES \`onboarding_plans\`(\`id\`) ON DELETE CASCADE ON UPDATE NO ACTION`);
        }
        catch (e) { }
        try {
            await queryRunner.query(`ALTER TABLE \`onboarding_plan_tasks\` ADD CONSTRAINT \`FK_23275a0023200ab03dfcaa21189\` FOREIGN KEY (\`stage_id\`) REFERENCES \`onboarding_plan_stages\`(\`id\`) ON DELETE CASCADE ON UPDATE NO ACTION`);
        }
        catch (e) { }
        try {
            await queryRunner.query(`ALTER TABLE \`onboarding_records\` ADD CONSTRAINT \`FK_f9b8930c6a9014c8cdb46ad3735\` FOREIGN KEY (\`application_id\`) REFERENCES \`job_applications\`(\`id\`) ON DELETE SET NULL ON UPDATE NO ACTION`);
        }
        catch (e) { }
        try {
            await queryRunner.query(`ALTER TABLE \`onboarding_records\` ADD CONSTRAINT \`FK_30c5e835e267ab6ecf57cd14c1b\` FOREIGN KEY (\`member_id\`) REFERENCES \`members\`(\`id\`) ON DELETE SET NULL ON UPDATE NO ACTION`);
        }
        catch (e) { }
        try {
            await queryRunner.query(`ALTER TABLE \`onboarding_records\` ADD CONSTRAINT \`FK_eb0da6c60e1928d9c186a3023d5\` FOREIGN KEY (\`job_posting_id\`) REFERENCES \`job_postings\`(\`id\`) ON DELETE SET NULL ON UPDATE NO ACTION`);
        }
        catch (e) { }
        try {
            await queryRunner.query(`ALTER TABLE \`onboarding_records\` ADD CONSTRAINT \`FK_2d6e43c915a361d7aa751ed5071\` FOREIGN KEY (\`plan_id\`) REFERENCES \`onboarding_plans\`(\`id\`) ON DELETE SET NULL ON UPDATE NO ACTION`);
        }
        catch (e) { }
        try {
            await queryRunner.query(`ALTER TABLE \`onboarding_records\` ADD CONSTRAINT \`FK_f2be31902dfec9b36bd0ad851a2\` FOREIGN KEY (\`owner_id\`) REFERENCES \`owner\`(\`id\`) ON DELETE RESTRICT ON UPDATE NO ACTION`);
        }
        catch (e) { }
        try {
            await queryRunner.query(`ALTER TABLE \`onboarding_tasks\` ADD CONSTRAINT \`FK_1f3842f02aa6185fe78cd5b5bba\` FOREIGN KEY (\`record_id\`) REFERENCES \`onboarding_records\`(\`id\`) ON DELETE CASCADE ON UPDATE NO ACTION`);
        }
        catch (e) { }
        try {
            await queryRunner.query(`ALTER TABLE \`onboarding_tasks\` ADD CONSTRAINT \`FK_cc13ea291f32933b8ef9286ad9a\` FOREIGN KEY (\`assignee_member_id\`) REFERENCES \`members\`(\`id\`) ON DELETE SET NULL ON UPDATE NO ACTION`);
        }
        catch (e) { }
        try {
            await queryRunner.query(`ALTER TABLE \`_noticemembers\` ADD CONSTRAINT \`FK_437b01e78617216cee08c0fcf68\` FOREIGN KEY (\`B\`) REFERENCES \`notices\`(\`id\`) ON DELETE CASCADE ON UPDATE CASCADE`);
        }
        catch (e) { }
        try {
            await queryRunner.query(`ALTER TABLE \`_noticemembers\` ADD CONSTRAINT \`FK_77f433ff00143df684e03dfb093\` FOREIGN KEY (\`A\`) REFERENCES \`members\`(\`id\`) ON DELETE NO ACTION ON UPDATE NO ACTION`);
        }
        catch (e) { }
    }
    async down(queryRunner) {
        await queryRunner.query(`ALTER TABLE \`_noticemembers\` DROP FOREIGN KEY \`FK_77f433ff00143df684e03dfb093\``);
        await queryRunner.query(`ALTER TABLE \`_noticemembers\` DROP FOREIGN KEY \`FK_437b01e78617216cee08c0fcf68\``);
        await queryRunner.query(`ALTER TABLE \`onboarding_tasks\` DROP FOREIGN KEY \`FK_cc13ea291f32933b8ef9286ad9a\``);
        await queryRunner.query(`ALTER TABLE \`onboarding_tasks\` DROP FOREIGN KEY \`FK_1f3842f02aa6185fe78cd5b5bba\``);
        await queryRunner.query(`ALTER TABLE \`onboarding_records\` DROP FOREIGN KEY \`FK_f2be31902dfec9b36bd0ad851a2\``);
        await queryRunner.query(`ALTER TABLE \`onboarding_records\` DROP FOREIGN KEY \`FK_2d6e43c915a361d7aa751ed5071\``);
        await queryRunner.query(`ALTER TABLE \`onboarding_records\` DROP FOREIGN KEY \`FK_eb0da6c60e1928d9c186a3023d5\``);
        await queryRunner.query(`ALTER TABLE \`onboarding_records\` DROP FOREIGN KEY \`FK_30c5e835e267ab6ecf57cd14c1b\``);
        await queryRunner.query(`ALTER TABLE \`onboarding_records\` DROP FOREIGN KEY \`FK_f9b8930c6a9014c8cdb46ad3735\``);
        await queryRunner.query(`ALTER TABLE \`onboarding_plan_tasks\` DROP FOREIGN KEY \`FK_23275a0023200ab03dfcaa21189\``);
        await queryRunner.query(`ALTER TABLE \`onboarding_plan_tasks\` DROP FOREIGN KEY \`FK_e2bc3ebb36342d3750c09a63a11\``);
        await queryRunner.query(`ALTER TABLE \`onboarding_plan_stages\` DROP FOREIGN KEY \`FK_fad73767336d9f3767945c1756c\``);
        await queryRunner.query(`ALTER TABLE \`onboarding_plans\` DROP FOREIGN KEY \`FK_a01ccba12fdd69ef7b6fa757fbb\``);
        await queryRunner.query(`ALTER TABLE \`onboarding_plans\` DROP FOREIGN KEY \`FK_7e2e844f19adaf524beae2aff5c\``);
        await queryRunner.query(`ALTER TABLE \`tenant_api_keys\` DROP FOREIGN KEY \`FK_237cb086210e280a9b970ef8297\``);
        await queryRunner.query(`ALTER TABLE \`recruitment_tasks\` DROP FOREIGN KEY \`FK_d8cce905e6febd44f2953b0e381\``);
        await queryRunner.query(`ALTER TABLE \`job_applications\` DROP FOREIGN KEY \`FK_8cb08b14a02a95de3f6e016f906\``);
        await queryRunner.query(`ALTER TABLE \`job_applications\` DROP FOREIGN KEY \`FK_1f0ed6a45088ef95236af37a5f4\``);
        await queryRunner.query(`ALTER TABLE \`job_postings\` DROP FOREIGN KEY \`FK_1c15a925edd72ad7be5e24a23d8\``);
        await queryRunner.query(`ALTER TABLE \`job_postings\` DROP FOREIGN KEY \`FK_cf838f9c48f90ad76d0f2d231e5\``);
        await queryRunner.query(`ALTER TABLE \`role_permissions\` DROP FOREIGN KEY \`FK_178199805b901ccd220ab7740ec\``);
        await queryRunner.query(`ALTER TABLE \`access_roles\` DROP FOREIGN KEY \`FK_865a3eba106030747f582005591\``);
        await queryRunner.query(`ALTER TABLE \`holidays\` DROP FOREIGN KEY \`FK_1ef09ffe0cbce46bc8847a31d6d\``);
        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_1bc2b285faf97bd00a37a3f436d\``);
        await queryRunner.query(`ALTER TABLE \`attendance_requests\` DROP FOREIGN KEY \`FK_df7290b8a7336c4e176c843a631\``);
        await queryRunner.query(`ALTER TABLE \`leaves\` DROP FOREIGN KEY \`FK_7d93f1b2454bf8b4ee0fc58c500\``);
        await queryRunner.query(`ALTER TABLE \`leaves\` DROP FOREIGN KEY \`FK_4c5cbdf59315fddae800bc0d545\``);
        await queryRunner.query(`ALTER TABLE \`attendances\` DROP FOREIGN KEY \`FK_b47acfc6e4d108d060e7b9c16ad\``);
        await queryRunner.query(`ALTER TABLE \`attendances\` DROP FOREIGN KEY \`FK_2356832877cbc5cf26aca84e198\``);
        await queryRunner.query(`ALTER TABLE \`attendance_breaks\` DROP FOREIGN KEY \`FK_0edf01e362647cf09a71ba4518c\``);
        await queryRunner.query(`ALTER TABLE \`educations\` DROP FOREIGN KEY \`FK_b468e7e6265a4464c58c55b9658\``);
        await queryRunner.query(`ALTER TABLE \`educations\` DROP FOREIGN KEY \`FK_374560373a83e332f78def538cc\``);
        await queryRunner.query(`ALTER TABLE \`work_experiences\` DROP FOREIGN KEY \`FK_38e7588937c7ca136acf8a3a3b1\``);
        await queryRunner.query(`ALTER TABLE \`work_experiences\` DROP FOREIGN KEY \`FK_53673af6504eca1ce63e62b22a6\``);
        await queryRunner.query(`ALTER TABLE \`members\` DROP FOREIGN KEY \`FK_764bf7ff2544b85cf1a8298d03e\``);
        await queryRunner.query(`ALTER TABLE \`notices\` DROP FOREIGN KEY \`FK_6e8f4aeffb70eff67e72c792ea3\``);
        await queryRunner.query(`ALTER TABLE \`events\` DROP FOREIGN KEY \`FK_918130b4f882fda431503d6f4e0\``);
        await queryRunner.query(`ALTER TABLE \`hiring_sources\` DROP FOREIGN KEY \`FK_caf0a00f832838bd658f358b4d6\``);
        await queryRunner.query(`ALTER TABLE \`employement_types\` DROP FOREIGN KEY \`FK_5e57334eca32b397f8cedaf04e5\``);
        await queryRunner.query(`ALTER TABLE \`locations\` DROP FOREIGN KEY \`FK_2ce5c9e8fd1c1f0945db786e308\``);
        await queryRunner.query(`ALTER TABLE \`designations\` DROP FOREIGN KEY \`FK_4728de48d7d4a0323c4f581c880\``);
        await queryRunner.query(`ALTER TABLE \`departments\` DROP FOREIGN KEY \`FK_392bbf7a4cf28bd0cdfa69a8970\``);
        await queryRunner.query(`ALTER TABLE \`leave_policy\` DROP FOREIGN KEY \`FK_e8665e3b253027261a8af249452\``);
        await queryRunner.query(`ALTER TABLE \`working_schedule\` DROP FOREIGN KEY \`FK_2814f05e73089b95f0a7e9bc58b\``);
        await queryRunner.query(`ALTER TABLE \`company\` DROP FOREIGN KEY \`FK_0c6ea8a32565efcb512e572d61d\``);
        await queryRunner.query(`DROP INDEX \`IDX_77f433ff00143df684e03dfb09\` ON \`_noticemembers\``);
        await queryRunner.query(`DROP INDEX \`IDX_437b01e78617216cee08c0fcf6\` ON \`_noticemembers\``);
        await queryRunner.query(`DROP INDEX \`IDX_1f3842f02aa6185fe78cd5b5bb\` ON \`onboarding_tasks\``);
        await queryRunner.query(`DROP INDEX \`IDX_f2be31902dfec9b36bd0ad851a\` ON \`onboarding_records\``);
        await queryRunner.query(`DROP INDEX \`IDX_f9b8930c6a9014c8cdb46ad373\` ON \`onboarding_records\``);
        await queryRunner.query(`DROP INDEX \`IDX_30c5e835e267ab6ecf57cd14c1\` ON \`onboarding_records\``);
        await queryRunner.query(`DROP INDEX \`IDX_e2bc3ebb36342d3750c09a63a1\` ON \`onboarding_plan_tasks\``);
        await queryRunner.query(`DROP INDEX \`IDX_23275a0023200ab03dfcaa2118\` ON \`onboarding_plan_tasks\``);
        await queryRunner.query(`DROP INDEX \`IDX_a01ccba12fdd69ef7b6fa757fb\` ON \`onboarding_plans\``);
        await queryRunner.query(`DROP INDEX \`IDX_237cb086210e280a9b970ef829\` ON \`tenant_api_keys\``);
        await queryRunner.query(`DROP INDEX \`IDX_61663ce74670592f96d7cc5d34\` ON \`tenant_api_keys\``);
        await queryRunner.query(`DROP INDEX \`IDX_d8cce905e6febd44f2953b0e38\` ON \`recruitment_tasks\``);
        await queryRunner.query(`DROP INDEX \`IDX_8cb08b14a02a95de3f6e016f90\` ON \`job_applications\``);
        await queryRunner.query(`DROP INDEX \`IDX_1f0ed6a45088ef95236af37a5f\` ON \`job_applications\``);
        await queryRunner.query(`DROP INDEX \`IDX_2f2d5f25a87c7f6a6ab3e5f4dc\` ON \`job_applications\``);
        await queryRunner.query(`DROP INDEX \`IDX_08eeecc093f1bb82b062df7883\` ON \`job_postings\``);
        await queryRunner.query(`DROP INDEX \`IDX_1c15a925edd72ad7be5e24a23d\` ON \`job_postings\``);
        await queryRunner.query(`DROP INDEX \`IDX_cf838f9c48f90ad76d0f2d231e\` ON \`job_postings\``);
        await queryRunner.query(`DROP INDEX \`IDX_064de54701f3ac10466efa130a\` ON \`role_permissions\``);
        await queryRunner.query(`DROP INDEX \`IDX_9c18d618c2563fd5fa913c22d4\` ON \`access_roles\``);
        await queryRunner.query(`DROP INDEX \`IDX_2c57d7f989049e0b4e2b5986ee\` ON \`attendance_requests\``);
        await queryRunner.query(`DROP INDEX \`IDX_df7290b8a7336c4e176c843a63\` ON \`attendance_requests\``);
        await queryRunner.query(`DROP INDEX \`IDX_cb0102f5790efbd055116b4037\` ON \`attendance_requests\``);
        await queryRunner.query(`DROP INDEX \`IDX_1bc2b285faf97bd00a37a3f436\` ON \`attendance_requests\``);
        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_records\` CHANGE \`updated_at\` \`updated_at\` datetime(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)`);
        await queryRunner.query(`ALTER TABLE \`onboarding_records\` CHANGE \`created_at\` \`created_at\` datetime(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3)`);
        await queryRunner.query(`ALTER TABLE \`onboarding_plan_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_plan_tasks\` CHANGE \`created_at\` \`created_at\` datetime(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3)`);
        await queryRunner.query(`ALTER TABLE \`onboarding_plans\` CHANGE \`updated_at\` \`updated_at\` datetime(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)`);
        await queryRunner.query(`ALTER TABLE \`onboarding_plans\` 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 \`recruitment_tasks\` DROP INDEX \`IDX_51fd985d4f484f53a79dbc4e66\``);
        await queryRunner.query(`ALTER TABLE \`recruitment_tasks\` CHANGE \`public_token\` \`public_token\` varchar(191) COLLATE "utf8mb4_general_ci" NOT NULL`);
        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_applications\` CHANGE \`applied_at\` \`applied_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 \`role_permissions\` CHANGE \`updated_at\` \`updated_at\` datetime(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)`);
        await queryRunner.query(`ALTER TABLE \`role_permissions\` CHANGE \`created_at\` \`created_at\` datetime(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3)`);
        await queryRunner.query(`ALTER TABLE \`access_roles\` CHANGE \`updated_at\` \`updated_at\` datetime(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)`);
        await queryRunner.query(`ALTER TABLE \`access_roles\` 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') 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 \`attendance_requests\` DROP COLUMN \`owner_id\``);
        await queryRunner.query(`ALTER TABLE \`attendance_requests\` ADD \`owner_id\` varchar(36) COLLATE "utf8mb4_general_ci" NOT NULL`);
        await queryRunner.query(`ALTER TABLE \`attendance_requests\` DROP COLUMN \`member_id\``);
        await queryRunner.query(`ALTER TABLE \`attendance_requests\` ADD \`member_id\` varchar(36) COLLATE "utf8mb4_general_ci" NOT NULL`);
        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_plan_tasks\` DROP COLUMN \`stage_id\``);
        await queryRunner.query(`DROP INDEX \`IDX_fad73767336d9f3767945c1756\` ON \`onboarding_plan_stages\``);
        await queryRunner.query(`DROP TABLE \`onboarding_plan_stages\``);
        await queryRunner.query(`CREATE INDEX \`IDX_notice_members_B\` ON \`_noticemembers\` (\`B\`)`);
        await queryRunner.query(`CREATE INDEX \`IDX_notice_members_A\` ON \`_noticemembers\` (\`A\`)`);
        await queryRunner.query(`CREATE INDEX \`IDX_onboarding_tasks_record\` ON \`onboarding_tasks\` (\`record_id\`)`);
        await queryRunner.query(`CREATE INDEX \`IDX_onboarding_records_owner\` ON \`onboarding_records\` (\`owner_id\`)`);
        await queryRunner.query(`CREATE INDEX \`IDX_onboarding_records_member\` ON \`onboarding_records\` (\`member_id\`)`);
        await queryRunner.query(`CREATE INDEX \`IDX_onboarding_records_application\` ON \`onboarding_records\` (\`application_id\`)`);
        await queryRunner.query(`CREATE INDEX \`IDX_onboarding_plan_tasks_plan\` ON \`onboarding_plan_tasks\` (\`plan_id\`)`);
        await queryRunner.query(`CREATE INDEX \`IDX_onboarding_plans_owner\` ON \`onboarding_plans\` (\`owner_id\`)`);
        await queryRunner.query(`CREATE INDEX \`IDX_tenant_api_keys_prefix\` ON \`tenant_api_keys\` (\`key_prefix\`)`);
        await queryRunner.query(`CREATE INDEX \`IDX_tenant_api_keys_owner\` ON \`tenant_api_keys\` (\`owner_id\`)`);
        await queryRunner.query(`CREATE UNIQUE INDEX \`IDX_recruitment_tasks_token\` ON \`recruitment_tasks\` (\`public_token\`)`);
        await queryRunner.query(`CREATE INDEX \`IDX_recruitment_tasks_application\` ON \`recruitment_tasks\` (\`application_id\`)`);
        await queryRunner.query(`CREATE INDEX \`IDX_job_applications_status\` ON \`job_applications\` (\`status\`)`);
        await queryRunner.query(`CREATE INDEX \`IDX_job_applications_owner\` ON \`job_applications\` (\`owner_id\`)`);
        await queryRunner.query(`CREATE INDEX \`IDX_job_applications_job\` ON \`job_applications\` (\`job_posting_id\`)`);
        await queryRunner.query(`CREATE UNIQUE INDEX \`IDX_job_postings_owner_slug\` ON \`job_postings\` (\`owner_id\`, \`slug\`)`);
        await queryRunner.query(`CREATE INDEX \`IDX_job_postings_owner\` ON \`job_postings\` (\`owner_id\`)`);
        await queryRunner.query(`CREATE INDEX \`IDX_job_postings_department\` ON \`job_postings\` (\`department_id\`)`);
        await queryRunner.query(`CREATE UNIQUE INDEX \`IDX_role_permissions_role_key\` ON \`role_permissions\` (\`role_id\`, \`permission_key\`)`);
        await queryRunner.query(`CREATE UNIQUE INDEX \`IDX_access_roles_owner_slug\` ON \`access_roles\` (\`owner_id\`, \`slug\`)`);
        await queryRunner.query(`CREATE INDEX \`IDX_attendance_requests_owner_id\` ON \`attendance_requests\` (\`owner_id\`)`);
        await queryRunner.query(`CREATE INDEX \`IDX_attendance_requests_member_date_status\` ON \`attendance_requests\` (\`member_id\`, \`request_date\`, \`status\`)`);
        await queryRunner.query(`CREATE INDEX \`IDX_attendance_requests_attendance_id\` ON \`attendance_requests\` (\`attendance_id\`)`);
        await queryRunner.query(`ALTER TABLE \`_noticemembers\` ADD CONSTRAINT \`FK_notice_members_notice\` FOREIGN KEY (\`B\`) REFERENCES \`notices\`(\`id\`) ON DELETE CASCADE ON UPDATE CASCADE`);
        await queryRunner.query(`ALTER TABLE \`_noticemembers\` ADD CONSTRAINT \`FK_notice_members_member\` FOREIGN KEY (\`A\`) REFERENCES \`members\`(\`id\`) ON DELETE NO ACTION ON UPDATE NO ACTION`);
        await queryRunner.query(`ALTER TABLE \`role_permissions\` ADD CONSTRAINT \`FK_role_permissions_role\` FOREIGN KEY (\`role_id\`) REFERENCES \`access_roles\`(\`id\`) ON DELETE CASCADE ON UPDATE NO ACTION`);
        await queryRunner.query(`ALTER TABLE \`access_roles\` ADD CONSTRAINT \`FK_access_roles_owner\` FOREIGN KEY (\`owner_id\`) REFERENCES \`owner\`(\`id\`) ON DELETE CASCADE ON UPDATE NO ACTION`);
        await queryRunner.query(`ALTER TABLE \`holidays\` ADD CONSTRAINT \`FK_1ef09ffe0cbce46bc8847a31d6d\` FOREIGN KEY (\`owner_id\`) REFERENCES \`owner\`(\`id\`) ON DELETE NO ACTION ON UPDATE NO ACTION`);
        await queryRunner.query(`ALTER TABLE \`attendance_requests\` ADD CONSTRAINT \`FK_attendance_requests_owner\` FOREIGN KEY (\`owner_id\`) REFERENCES \`owner\`(\`id\`) ON DELETE RESTRICT ON UPDATE NO ACTION`);
        await queryRunner.query(`ALTER TABLE \`attendance_requests\` ADD CONSTRAINT \`FK_attendance_requests_member\` FOREIGN KEY (\`member_id\`) REFERENCES \`members\`(\`id\`) ON DELETE RESTRICT ON UPDATE NO ACTION`);
        await queryRunner.query(`ALTER TABLE \`attendance_requests\` ADD CONSTRAINT \`FK_attendance_requests_attendance\` FOREIGN KEY (\`attendance_id\`) REFERENCES \`attendances\`(\`id\`) ON DELETE SET NULL ON UPDATE NO ACTION`);
        await queryRunner.query(`ALTER TABLE \`leaves\` ADD CONSTRAINT \`FK_7d93f1b2454bf8b4ee0fc58c500\` FOREIGN KEY (\`owner_id\`) REFERENCES \`owner\`(\`id\`) ON DELETE NO ACTION ON UPDATE NO ACTION`);
        await queryRunner.query(`ALTER TABLE \`leaves\` ADD CONSTRAINT \`FK_4c5cbdf59315fddae800bc0d545\` FOREIGN KEY (\`member_id\`) REFERENCES \`members\`(\`id\`) ON DELETE NO ACTION ON UPDATE NO ACTION`);
        await queryRunner.query(`ALTER TABLE \`attendances\` ADD CONSTRAINT \`FK_b47acfc6e4d108d060e7b9c16ad\` FOREIGN KEY (\`owner_id\`) REFERENCES \`owner\`(\`id\`) ON DELETE NO ACTION ON UPDATE NO ACTION`);
        await queryRunner.query(`ALTER TABLE \`attendances\` ADD CONSTRAINT \`FK_2356832877cbc5cf26aca84e198\` FOREIGN KEY (\`member_id\`) REFERENCES \`members\`(\`id\`) ON DELETE NO ACTION ON UPDATE NO ACTION`);
        await queryRunner.query(`ALTER TABLE \`attendance_breaks\` ADD CONSTRAINT \`FK_0edf01e362647cf09a71ba4518c\` FOREIGN KEY (\`owner_id\`) REFERENCES \`owner\`(\`id\`) ON DELETE NO ACTION ON UPDATE NO ACTION`);
        await queryRunner.query(`ALTER TABLE \`educations\` ADD CONSTRAINT \`FK_b468e7e6265a4464c58c55b9658\` FOREIGN KEY (\`owner_id\`) REFERENCES \`owner\`(\`id\`) ON DELETE NO ACTION ON UPDATE NO ACTION`);
        await queryRunner.query(`ALTER TABLE \`educations\` ADD CONSTRAINT \`FK_374560373a83e332f78def538cc\` FOREIGN KEY (\`member_id\`) REFERENCES \`members\`(\`id\`) ON DELETE NO ACTION ON UPDATE NO ACTION`);
        await queryRunner.query(`ALTER TABLE \`work_experiences\` ADD CONSTRAINT \`FK_53673af6504eca1ce63e62b22a6\` FOREIGN KEY (\`member_id\`) REFERENCES \`members\`(\`id\`) ON DELETE NO ACTION ON UPDATE NO ACTION`);
        await queryRunner.query(`ALTER TABLE \`work_experiences\` ADD CONSTRAINT \`FK_38e7588937c7ca136acf8a3a3b1\` FOREIGN KEY (\`owner_id\`) REFERENCES \`owner\`(\`id\`) ON DELETE NO ACTION ON UPDATE NO ACTION`);
        await queryRunner.query(`ALTER TABLE \`members\` ADD CONSTRAINT \`FK_members_access_role\` FOREIGN KEY (\`access_role_id\`) REFERENCES \`access_roles\`(\`id\`) ON DELETE SET NULL ON UPDATE NO ACTION`);
        await queryRunner.query(`ALTER TABLE \`members\` ADD CONSTRAINT \`FK_764bf7ff2544b85cf1a8298d03e\` FOREIGN KEY (\`owner_id\`) REFERENCES \`owner\`(\`id\`) ON DELETE NO ACTION ON UPDATE NO ACTION`);
        await queryRunner.query(`ALTER TABLE \`notices\` ADD CONSTRAINT \`FK_6e8f4aeffb70eff67e72c792ea3\` FOREIGN KEY (\`owner_id\`) REFERENCES \`owner\`(\`id\`) ON DELETE NO ACTION ON UPDATE NO ACTION`);
        await queryRunner.query(`ALTER TABLE \`events\` ADD CONSTRAINT \`FK_918130b4f882fda431503d6f4e0\` FOREIGN KEY (\`owner_id\`) REFERENCES \`owner\`(\`id\`) ON DELETE NO ACTION ON UPDATE NO ACTION`);
        await queryRunner.query(`ALTER TABLE \`hiring_sources\` ADD CONSTRAINT \`FK_caf0a00f832838bd658f358b4d6\` FOREIGN KEY (\`owner_id\`) REFERENCES \`owner\`(\`id\`) ON DELETE NO ACTION ON UPDATE NO ACTION`);
        await queryRunner.query(`ALTER TABLE \`employement_types\` ADD CONSTRAINT \`FK_5e57334eca32b397f8cedaf04e5\` FOREIGN KEY (\`owner_id\`) REFERENCES \`owner\`(\`id\`) ON DELETE NO ACTION ON UPDATE NO ACTION`);
        await queryRunner.query(`ALTER TABLE \`locations\` ADD CONSTRAINT \`FK_2ce5c9e8fd1c1f0945db786e308\` FOREIGN KEY (\`owner_id\`) REFERENCES \`owner\`(\`id\`) ON DELETE NO ACTION ON UPDATE NO ACTION`);
        await queryRunner.query(`ALTER TABLE \`designations\` ADD CONSTRAINT \`FK_4728de48d7d4a0323c4f581c880\` FOREIGN KEY (\`owner_id\`) REFERENCES \`owner\`(\`id\`) ON DELETE NO ACTION ON UPDATE NO ACTION`);
        await queryRunner.query(`ALTER TABLE \`departments\` ADD CONSTRAINT \`FK_392bbf7a4cf28bd0cdfa69a8970\` FOREIGN KEY (\`owner_id\`) REFERENCES \`owner\`(\`id\`) ON DELETE NO ACTION ON UPDATE NO ACTION`);
        await queryRunner.query(`ALTER TABLE \`leave_policy\` ADD CONSTRAINT \`FK_e8665e3b253027261a8af249452\` FOREIGN KEY (\`owner_id\`) REFERENCES \`owner\`(\`id\`) ON DELETE NO ACTION ON UPDATE NO ACTION`);
        await queryRunner.query(`ALTER TABLE \`working_schedule\` ADD CONSTRAINT \`FK_2814f05e73089b95f0a7e9bc58b\` FOREIGN KEY (\`owner_id\`) REFERENCES \`owner\`(\`id\`) ON DELETE NO ACTION ON UPDATE NO ACTION`);
        await queryRunner.query(`ALTER TABLE \`company\` ADD CONSTRAINT \`FK_0c6ea8a32565efcb512e572d61d\` FOREIGN KEY (\`owner_id\`) REFERENCES \`owner\`(\`id\`) ON DELETE NO ACTION ON UPDATE NO ACTION`);
    }
}
exports.NewDatabaseConnection1784656414320 = NewDatabaseConnection1784656414320;
//# sourceMappingURL=1784656414320-NewDatabaseConnection.js.map