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



$migrations->Run('2023-11-21_online_users_indexes.php', <<<'DB_UPDATE_FILE'
<?php
/** @var \Claromentis\Setup\SetupFacade $migrations */

$database = $migrations->GetDb();

$database->CreateIndex('users', 'users_online', 'last_time_used', 'intranetuser');

DB_UPDATE_FILE
);


$migrations->Run('2023-11-22_online_users_indexes.php', <<<'DB_UPDATE_FILE'
<?php
/** @var \Claromentis\Setup\SetupFacade $migrations */

$database = $migrations->GetDb();

$database->DropIndex('users', 'users_online');
$database->CreateIndex('users', 'users_online', 'intranetuser', 'last_time_used');

DB_UPDATE_FILE
);


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