<?php
// 7.1 beta
if (!isset($migrations) || !is_object($migrations))
	die("This file cannot be executed directly");

	/* Script "11_im_recipients_index.php" starts */ 

$db->DropIndex('im_recipients', 'im_recipients_readyet');
$db->DropIndex('im_recipients', 'im_recipients_deleted');
$db->CreateIndex('im_recipients', 'im_recipients_del_read', 'deleted', 'readyet');


 /* Script "11_im_recipients_index.php" ends */ 
 /* Script "12_ic_drafts.php" starts */ 

$table_descr = array(
	'id' => 'IDENTITY',
	'user_id' => 'INT',
	'project_id' => 'INT NOT_NULL',
	'date_created' => 'INT_DATE',
	'status' => 'INT',
	'data' => 'CLOB',
);
$db->CreateTable('hd_issue_draft', $table_descr, true);


 /* Script "12_ic_drafts.php" ends */ 
 /* Script "13_notifiation_digest.php" starts */ 

$table_descr = array(
	'id' => 'IDENTITY',
	'im_msg_id' => 'INT',
	'user_id' => 'INT',
	'app_type' => 'INT'
);

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

$table_descr = array(
	'user_id' => 'INT',
	'interval_type' => 'INT',
	'last_sent' => 'INT_DATE',
	'next_send' => 'INT_DATE'
);

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

$db->AddColumn('im_recipients', 'digest', "INT DEFAULT 0");


 /* Script "13_notifiation_digest.php" ends */ ?>
