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



$migrations->Run('01_sys_calendars.php', <<<'DB_UPDATE_FILE'
<?php
/** @var \Claromentis\Setup\SetupFacade $migrations */
$config = $migrations->GetConfigFull('');
$cfg_cln_system_calendars = $config->Get('cfg_cln_system_calendars');
$calendars_number = count($cfg_cln_system_calendars);
$new_calendars = array_diff($cfg_cln_system_calendars, ['CalendarHpProvider', 'HpTeamCalendarProvider']);
if (count($new_calendars) < count($cfg_cln_system_calendars))
{
	$config->Set('cfg_cln_system_calendars', $new_calendars);
	$config->Save();
}

DB_UPDATE_FILE
);


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