<?php
$result = run_query("SHOW COLUMNS FROM " . $config['table_prefix'] . "schemes LIKE 'gradient_stat'");
if (!sql_fetch_assoc($result)) {
    run_query("ALTER TABLE " . $config['table_prefix'] . "schemes ADD gradient_stat TINYINT(1) DEFAULT '0' NOT NULL");
}
$result = run_query("SHOW COLUMNS FROM " . $config['table_prefix'] . "schemes LIKE 'size_opacity'");
if (!sql_fetch_array($result)) {
    run_query("ALTER TABLE " . $config['table_prefix'] . "schemes ADD size_opacity FLOAT(1) NOT NULL");
}
$result = run_query("SHOW COLUMNS FROM " . $config['table_prefix'] . "schemes LIKE 'img_select'");
if (!sql_fetch_array($result)) {
    run_query("ALTER TABLE " . $config['table_prefix'] . "schemes ADD img_select VARCHAR(255) NOT NULL");
}
$result = run_query("SHOW COLUMNS FROM " . $config['table_prefix'] . "schemes LIKE 'table_bg'");
if (!sql_fetch_array($result)) {
    run_query("ALTER TABLE " . $config['table_prefix'] . "schemes ADD table_bg TINYINT(1) DEFAULT '1' NOT NULL");
}
$result = run_query("SHOW COLUMNS FROM " . $config['table_prefix'] . "schemes LIKE 'radius_menu'");
if (!sql_fetch_array($result)) {
    run_query("ALTER TABLE " . $config['table_prefix'] . "schemes ADD radius_menu TINYINT(1) DEFAULT '1' NOT NULL");
}
$result = run_query("SHOW COLUMNS FROM " . $config['table_prefix'] . "schemes LIKE 'color4'");
if (!sql_fetch_array($result)) {
    run_query("ALTER TABLE " . $config['table_prefix'] . "schemes ADD color4 VARCHAR(255) NOT NULL AFTER color3");
}
$result = run_query("SHOW COLUMNS FROM " . $config['table_prefix'] . "schemes LIKE 'color4'");
if (sql_fetch_array($result)) {
    run_query("UPDATE " . $config['table_prefix'] . "schemes SET color4 = color2");
}