<?php
// Доконвертируем тип поля в новых таблицах/полях (добавленных после ревизии 4458)
$result = run_query("SHOW TABLES LIKE '" . $config["table_prefix"] . "data%'");
while ($table = mysqli_fetch_array($result)) {
    run_query("ALTER TABLE `" . $table[0] . "` CHANGE `add_time` `add_time` TIMESTAMP NOT NULL DEFAULT '0000-00-00 00:00:00'");
}
$result = run_query("SELECT * FROM " . $config["table_prefix"] . "fields WHERE type_field=2 and type_value=1");
while ($field = mysqli_fetch_array($result)) {
    run_query("ALTER TABLE " . $config["table_prefix"] . "data" . $field['table_id'] . " CHANGE `f" . $field['id'] . "` `f" . $field['id'] . "` TIMESTAMP NOT NULL DEFAULT '0000-00-00 00:00:00'");
}
?>