<?php
$_db_migration_to = '40.19'; // 9.0.12
if (!isset($migrations) || !is_object($migrations))
	die("This file cannot be executed directly");
$migrations->CheckValid($_db_migration_to);
//===========================================================================================



$migrations->Run('231110_reapply_infocapture_index_migration.php', <<<'DB_UPDATE_FILE'
<?php

try {
	/**
	 * BT-4285 open items component loading time optimizations
	 *
	 * Re-applied from 8.13. Initial migration name: 20231003_hd_issues_add_indexes.php
	 *
	 * @var \Claromentis\Setup\SetupFacade $migrations
	 */
	$db = $migrations->GetDb();

	// Create indexes to improve loading time for open items component
	$db->CreateIndex('hd_issue', 'idx_status_form_data_project_id', 'status', 'form_data_id', 'project_id');
	$db->CreateIndex('hd_status_group_member', 'idx_group_id', 'group_id');
} catch (\Throwable $throwable) {
	$logger = $migrations->getLogger();

	$logger->warning($throwable->getMessage());
	$logger->debug($throwable);
}

DB_UPDATE_FILE
);


//===========================================================================================
$migrations->SetVersion('40.19');
