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



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

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

$db->AddColumn('hpl_config', 'ical_notification', "INT NULL DEFAULT 0");
DB_UPDATE_FILE
);


$migrations->Run('01_permission_reports.php', <<<'DB_UPDATE_FILE'
<?php
/** @var $migrations \Claromentis\Setup\SetupFacade */
$db = $migrations->GetDb();
$table_descr = array(
	'groupid'	=>	"INT NULL",
	'userid'	=>	"INT NULL",
);

$db->CreateTable('hpl_group_report_users', $table_descr, true);
DB_UPDATE_FILE
);


$migrations->Run('02_json_remove_date_format.php', <<<'DB_UPDATE_FILE'
<?php

/** @var $migrations \Claromentis\Setup\SetupFacade */
$config = $migrations->GetConfigFull();
$config->Get('date_format');
$config->Delete('date_format');
$config->Save();
DB_UPDATE_FILE
);


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