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



$migrations->Run('01_ic_private_notes.php', <<<'DB_UPDATE_FILE'
<?php
/** @var \Claromentis\Setup\SetupFacade $migrations */

$db = $migrations->GetDb();
$db->AddColumn('hd_project', 'private_notes', 'INT DEFAULT 0');
$db->AddColumn('hd_project', 'private_notes_rights', 'INT DEFAULT 0');
//$db->AddColumn('hd_issue_note', 'private', 'BOOL DEFAULT 0');
//$db->query('UPDATE hd_issue_note SET private = 0 WHERE private IS NULL');
DB_UPDATE_FILE
);


$migrations->Run('02_ic_private_notes_mysql.php', <<<'DB_UPDATE_FILE'
<?php
/** @var \Claromentis\Setup\SetupFacade $migrations */
$db = $migrations->GetDb();
//$db->DropColumn('hd_issue_note', 'private');
$db->AddColumn('hd_issue_note', 'private_note', 'BOOL DEFAULT 0');
$db->query('UPDATE hd_issue_note SET private_note = 0 WHERE private_note IS NULL');
DB_UPDATE_FILE
);


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