<?php
//добавление поля check_conditions в таблицу buttons
$tableName =  $config['table_prefix'] . 'buttons';
$tableCheck = run_query("SELECT COUNT(*) as count FROM INFORMATION_SCHEMA.TABLES 
    WHERE TABLE_SCHEMA = DATABASE() AND TABLE_NAME = '{$tableName}'");
if($tableCheck['result']->fetch_assoc()['count'] != 0) {
    run_query('ALTER TABLE ' . $tableName.' ADD COLUMN IF NOT EXISTS `check_conditions` INT(11) DEFAULT 0');
}