r37371 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r37370‎ | r37371 | r37372 >
Date:07:06, 9 July 2008
Author:dale
Status:old
Tags:
Comment:
minor fix to DB table update
Modified paths:
  • /branches/MetavidWiki-exp/MetavidWiki/maintenance/mv_update.php (modified) (history)

Diff [purge]

Index: branches/MetavidWiki-exp/MetavidWiki/maintenance/mv_update.php
@@ -19,6 +19,7 @@
2020
2121 //install the new search index tables:
2222 if(!$wgDatabase->tableExists('mv_search_digest')){
 23+ echo 'CREATE TABLE mv_search_digest'."\n";
2324 $wgDatabase->query('CREATE TABLE IF NOT EXISTS `mv_search_digest` (
2425 `id` int(11) NOT NULL auto_increment,
2526 `query_key` varchar(128) character set utf8 collate utf8_unicode_ci NOT NULL,
@@ -28,6 +29,7 @@
2930 ) ENGINE=MyISAM');
3031 }
3132 if(!$wgDatabase->tableExists('mv_clipview_digest')){
 33+ echo 'CREATE TABLE mv_clipview_digest'."\n";
3234 $wgDatabase->query(" CREATE TABLE IF NOT EXISTS `mv_clipview_digest` (
3335 `id` int(11) NOT NULL auto_increment,
3436 `query_key` int(33) NOT NULL,
@@ -41,6 +43,7 @@
4244 ) ENGINE=MyISAM ;");
4345 }
4446 if(!$wgDatabase->tableExists('mv_query_key_lookup')){
 47+ echo 'CREATE TABLE mv_query_key_lookup'."\n";
4548 $wgDatabase->query("CREATE TABLE IF NOT EXISTS `mv_query_key_lookup` (
4649 `query_key` varchar(128) NOT NULL,
4750 `filters` text NOT NULL,
@@ -49,28 +52,29 @@
5053 }
5154
5255 if(!$wgDatabase->fieldExists('mv_mvd_index', 'view_count')){
 56+ echo '`mv_mvd_index` ADD `view_count`'."\n";
5357 $wgDatabase->query("ALTER TABLE `mv_mvd_index` ADD `view_count` INT( 10 ) UNSIGNED NOT NULL DEFAULT '0' AFTER `end_time`");
5458 }
5559 //add view_count index:
56 -if(!$wgDatabase->indexExists('view_count')){
 60+if(!$wgDatabase->indexExists('mv_mvd_index','view_count')){
5761 $wgDatabase->query("ALTER TABLE `mv_mvd_index` ADD INDEX ( `view_count` )");
5862 }
5963 /*modify mvd_table index structure for more "cardinality"/faster queries*/
60 -if($wgDatabase->indexExists('mvd_type')){
 64+if($wgDatabase->indexExists('mv_mvd_index','mvd_type')){
6165 $wgDatabase->query("ALTER TABLE `mv_mvd_index` DROP INDEX `mvd_type`");
6266 }
63 -if($wgDatabase->indexExists('stream_id')){
 67+if($wgDatabase->indexExists('mv_mvd_index','stream_id')){
6468 $wgDatabase->query("ALTER TABLE `mv_mvd_index` DROP INDEX `stream_id`");
6569 }
66 -if($wgDatabase->indexExists('stream_time_start')){
 70+if($wgDatabase->indexExists('mv_mvd_index','stream_time_start')){
6771 $wgDatabase->query("ALTER TABLE `mv_mvd_index` DROP INDEX `stream_time_start`");
6872 }
6973 //add missing indexes:
70 -if(!$wgDatabase->indexExists('mvd_stream_index')){
 74+if(!$wgDatabase->indexExists('mv_mvd_index','mvd_stream_index')){
7175 print "rebuilding mvd index ... this may take \"some time\"\n";
7276 $wgDatabase->query(" ALTER TABLE `mv_mvd_index` ADD INDEX `mvd_stream_index` ( `stream_id` , `start_time` , `end_time` )");
7377 }
74 -if(!$wgDatabase->indexExists('mvd_type_index')){
 78+if(!$wgDatabase->indexExists('mv_mvd_index','mvd_type_index')){
7579 $wgDatabase->query(" ALTER TABLE `mv_mvd_index` ADD INDEX `mvd_type_index` (`mvd_type`, `stream_id`)");
7680 }
7781

Status & tagging log