<?php
//добавление поля internal_service_fields в маппинг объекта интеграций
$tableName =  $config['table_prefix'] . 'integration_object_mapping';
$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 `internal_service_fields` text DEFAULT NULL');
}