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



$migrations->Run('240207_bt-4476_index_migration_reimplement.php', <<<'DB_UPDATE_FILE'
<?php

/**
 * BT-4476 Tickets loading time optimizations in IC
 *
 * Reimplemented in core v9 during merge forward from v8.13
 *
 * @var \Claromentis\Setup\SetupFacade $migrations
 */
$db = $migrations->GetDb();
$logger = $migrations->getLogger();

// Create indexes to improve loading time for tickets loading time in IC
try {
	$db->CreateIndex('hd_issue', 'idx_project_id_in_project', 'project_id', 'id_in_project');
} catch (\Throwable $throwable) {
	$logger->warning($throwable->getMessage());
	$logger->debug($throwable);
}

DB_UPDATE_FILE
);


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