<?php
$result = run_query('SHOW COLUMNS FROM ' . $config['table_prefix'] . "calc_template LIKE 'calc_types'");
if (!sql_fetch_assoc($result)) {
    run_query('
        ALTER TABLE ' . $config['table_prefix'] . 'calc_template
        ADD `calc_types` VARCHAR(255) DEFAULT \'[]\'
    ');
}