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



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

// For a brief time creating columns as "BOOL DEFAULT 1" would be saved as default 0 instead.
// This will fix any columns effected by that

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

$db->AlterColumn('pages_custom_component', 'is_live', 'is_live', 'BOOL NOT_NULL DEFAULT 1');
$db->AlterColumn('pages_menu_item', 'is_visible', 'is_visible', 'BOOL NOT_NULL DEFAULT 1');
DB_UPDATE_FILE
);


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