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



$migrations->Run('01_calendar_check_if_column_exists.php', <<<'DB_UPDATE_FILE'
<?php

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

// re-add "last_background_sync" column
$col = $db->GetColumnDescription('cln_calendar', 'last_background_sync');
if (empty($col))
{
	$db->AddColumn('cln_calendar', 'last_background_sync', "INT_DATE NOT_NULL DEFAULT 0");
}

DB_UPDATE_FILE
);


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