<?php

// проверим наличие поля в таблице
$result = sql_fetch_assoc(sql_query("
    SELECT COLUMN_NAME as name
    FROM INFORMATION_SCHEMA.COLUMNS
    WHERE (
        `TABLE_SCHEMA`='{$config['dbname']}' AND
        `TABLE_NAME`='{$config['table_prefix']}fields' AND
        `COLUMN_NAME`='no_outliers'
    )
"))['name'] ?? '';

// при отсутствии добавим
if (empty($result)) {
    run_query("
        ALTER TABLE {$config['table_prefix']}fields
        ADD COLUMN `no_outliers` tinyint(1) DEFAULT 0 AFTER `fix_search_mult`
    ");
}
