<?php
/**
 * Добавляем поле для настройки запланированной отправки шаблона
 * Created by: Voknil
 * Release: 12.06.2014
 * App Version: 2.0.3
 * Copyright: Clientbase (www.clientbase.ru)
 */

$res = run_query("SHOW COLUMNS FROM " . $config['table_prefix'] . "forms LIKE 'scheduled'");
if (!sql_num_rows($res)) {
    run_query("ALTER TABLE " . $config['table_prefix'] . "forms ADD scheduled TINYINT NOT NULL");
}

$res2 = run_query("SHOW COLUMNS FROM " . $config['table_prefix'] . "mail_threads LIKE 'scheduled_time'");
if (!sql_num_rows($res2)) {
    run_query("ALTER TABLE " . $config['table_prefix'] . "mail_threads ADD scheduled_time TIMESTAMP NOT NULL");
}

$res3 = run_query("SHOW COLUMNS FROM " . $config['table_prefix'] . "module_sms_threads LIKE 'scheduled_time'");
if (!sql_num_rows($res3)) {
    run_query("ALTER TABLE " . $config['table_prefix'] . "module_sms_threads ADD scheduled_time TIMESTAMP NOT NULL");
}
?>