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



$migrations->Run('2023-12-01_reimplement-online-users-indexes.php', <<<'DB_UPDATE_FILE'
<?php

try {
	/*
	 * Reimplementation of index migrations from 8.13.37:
	 * 2023-11-21_online_users_indexes.php
	 * 2023-11-22_online_users_indexes.php
	 */

	/** @var \Claromentis\Setup\SetupFacade $migrations */
	$database = $migrations->GetDb();

	$database->CreateIndex('users', 'users_online', 'intranetuser', 'last_time_used');
} catch (\Throwable $throwable) {
	$logger = $migrations->getLogger();

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

DB_UPDATE_FILE
);


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