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



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

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

// Links can be larger than 255 characters if they have extra info in (e.g. wrapped google search link, email campaign click tracking data)
// From Disco ticket 17045

$db->AlterColumn('news', 'link', 'link', 'VARCHAR(1024) NULL');
DB_UPDATE_FILE
);


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

/** @var $migrations \Claromentis\Setup\SetupFacade */
$db = $migrations->GetDb();
$table_description = array(
	'id'	=>	"IDENTITY",
	'created'	=>	"INT_DATE",
	'payload' => "CLOB",
	'is_sent' => "BOOL"
);

$db->CreateTable('telemetry_payloads', $table_description, true);

DB_UPDATE_FILE
);


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