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



$migrations->Run('01_create_indicies_for_stats.php', <<<'DB_UPDATE_FILE'
<?php
/** @var Claromentis\Setup\SetupFacade $migrations */
$db = $migrations->GetDb();

$db->CreateIndex("pages_url", "pages_url_site_id", "site_id");
$db->CreateIndex("pages_menu_item", "pages_menu_item_url_id", "url_id");
DB_UPDATE_FILE
);


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

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

$db->CreateIndex("pages_site", "pages_site_title", "title");

DB_UPDATE_FILE
);


$migrations->Run('03_create_further_indicies.php', <<<'DB_UPDATE_FILE'
<?php

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

$db->CreateIndex("pages_menu_item", "pages_menu_item_site_id", "site_id");
$db->CreateIndex("pages_menu_item", "pages_menu_item_parent_id", "parent_id");
$db->CreateIndex("pages_site", "pages_site_url_id", "url_id");


DB_UPDATE_FILE
);


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