database structure update
This commit is contained in:
@@ -165,4 +165,12 @@
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=utf8");
|
||||
}
|
||||
|
||||
function dbv_107() // sync of table definitions, developer and production system
|
||||
{
|
||||
sql("ALTER TABLE `caches` MODIFY `meta_last_modified` datetime NOT NULL COMMENT 'via Trigger (stat_caches, gk_item_waypoint)'");
|
||||
sql("ALTER TABLE `countries` MODIFY `en` varchar(128) NOT NULL");
|
||||
if (!sql_index_exists('cache_reports', 'userid'))
|
||||
sql("ALTER TABLE `cache_reports` ADD INDEX `userid` (`userid`)");
|
||||
}
|
||||
|
||||
?>
|
||||
@@ -12,5 +12,6 @@ CREATE TABLE `cache_reports` (
|
||||
`lastmodified` timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP,
|
||||
PRIMARY KEY (`id`),
|
||||
KEY `status` (`status`,`adminid`),
|
||||
KEY `status_2` (`adminid`,`status`)
|
||||
KEY `status_2` (`adminid`,`status`),
|
||||
KEY `userid` (`userid`)
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COMMENT='submitted reports on caches' ;
|
||||
|
||||
@@ -1120,4 +1120,15 @@
|
||||
'', $opt['db']['placeholder']['db'], $table, $field) );
|
||||
}
|
||||
|
||||
// test if a database index exists
|
||||
function sql_index_exists($table, $index)
|
||||
{
|
||||
global $opt;
|
||||
|
||||
return sql_value("SELECT COUNT(*)
|
||||
FROM `information_schema`.`statistics`
|
||||
WHERE `table_schema`='&1' AND `table_name`='&2' AND `index_name`='&3'",
|
||||
0, $opt['db']['placeholder']['db'], $table, $index) > 0;
|
||||
}
|
||||
|
||||
?>
|
||||
Reference in New Issue
Block a user