updated static table comments

This commit is contained in:
following
2013-05-08 14:43:07 +02:00
parent 2c3e84c2ef
commit 622024b24c
2 changed files with 33 additions and 1 deletions

View File

@@ -40,7 +40,18 @@
} while ($db_version > 0);
// test if a certain database field exists
// test if a database table exists
function table_exists($table)
{
global $opt;
return sql_value("SELECT COUNT(*)
FROM `information_schema`.`tables`
WHERE `table_schema`='&1' AND `table_name`='&2'",
0, $opt['db']['placeholder']['db'], $table) > 0;
}
// test if a database field exists
function field_exists($table, $field)
{
global $opt;
@@ -113,4 +124,24 @@
sql("CALL sp_refreshall_statpic()");
}
function dbv_103() // update comments on static tables
{
if (table_exists('geodb_areas')) sql("ALTER TABLE `geodb_areas` COMMENT = 'not in use'");
if (table_exists('geodb_changelog')) sql("ALTER TABLE `geodb_changelog` COMMENT = 'not in use'");
if (table_exists('geodb_coordinates')) sql("ALTER TABLE `geodb_coordinates` COMMENT = 'static content'");
if (table_exists('geodb_floatdata')) sql("ALTER TABLE `geodb_floatdata` COMMENT = 'not in use'");
if (table_exists('geodb_hierarchies')) sql("ALTER TABLE `geodb_hierarchies` COMMENT = 'static content'");
if (table_exists('geodb_intdata')) sql("ALTER TABLE `geodb_intdata` COMMENT = 'not in use'");
if (table_exists('geodb_locations')) sql("ALTER TABLE `geodb_locations` COMMENT = 'static content'");
if (table_exists('geodb_polygons')) sql("ALTER TABLE `geodb_polygons` COMMENT = 'not in use'");
if (table_exists('geodb_search')) sql("ALTER TABLE `geodb_search` COMMENT = 'static content, not in use'");
if (table_exists('geodb_textdata')) sql("ALTER TABLE `geodb_textdata` COMMENT = 'static content'");
if (table_exists('geodb_type_names')) sql("ALTER TABLE `geodb_type_names` COMMENT = 'not in use'");
if (table_exists('pw_dict')) sql("ALTER TABLE `pw_dict` COMMENT = 'static content'");
sql("ALTER TABLE `npa_areas` COMMENT = 'static content'");
sql("ALTER TABLE `npa_types` COMMENT = 'static content'");
sql("ALTER TABLE `nuts_codes` COMMENT = 'static content'");
sql("ALTER TABLE `nuts_layer` COMMENT = 'static content'");
}
?>

View File

@@ -32,6 +32,7 @@ License: GNU Free Documentation License
There are more geodb_ tables present in OC developer and production systems,
which are undocumented, mostly empty and not in use anywhere.
Probably some unfinished experiment.
(see bin/dbsv-update.php, mutation #103)
Tables: gns_locations