Index: branches/MetavidWiki-exp/MetavidWiki/maintenance/mv_update.php |
— | — | @@ -19,6 +19,7 @@ |
20 | 20 | |
21 | 21 | //install the new search index tables: |
22 | 22 | if(!$wgDatabase->tableExists('mv_search_digest')){ |
| 23 | + echo 'CREATE TABLE mv_search_digest'."\n"; |
23 | 24 | $wgDatabase->query('CREATE TABLE IF NOT EXISTS `mv_search_digest` ( |
24 | 25 | `id` int(11) NOT NULL auto_increment, |
25 | 26 | `query_key` varchar(128) character set utf8 collate utf8_unicode_ci NOT NULL, |
— | — | @@ -28,6 +29,7 @@ |
29 | 30 | ) ENGINE=MyISAM'); |
30 | 31 | } |
31 | 32 | if(!$wgDatabase->tableExists('mv_clipview_digest')){ |
| 33 | + echo 'CREATE TABLE mv_clipview_digest'."\n"; |
32 | 34 | $wgDatabase->query(" CREATE TABLE IF NOT EXISTS `mv_clipview_digest` ( |
33 | 35 | `id` int(11) NOT NULL auto_increment, |
34 | 36 | `query_key` int(33) NOT NULL, |
— | — | @@ -41,6 +43,7 @@ |
42 | 44 | ) ENGINE=MyISAM ;"); |
43 | 45 | } |
44 | 46 | if(!$wgDatabase->tableExists('mv_query_key_lookup')){ |
| 47 | + echo 'CREATE TABLE mv_query_key_lookup'."\n"; |
45 | 48 | $wgDatabase->query("CREATE TABLE IF NOT EXISTS `mv_query_key_lookup` ( |
46 | 49 | `query_key` varchar(128) NOT NULL, |
47 | 50 | `filters` text NOT NULL, |
— | — | @@ -49,28 +52,29 @@ |
50 | 53 | } |
51 | 54 | |
52 | 55 | if(!$wgDatabase->fieldExists('mv_mvd_index', 'view_count')){ |
| 56 | + echo '`mv_mvd_index` ADD `view_count`'."\n"; |
53 | 57 | $wgDatabase->query("ALTER TABLE `mv_mvd_index` ADD `view_count` INT( 10 ) UNSIGNED NOT NULL DEFAULT '0' AFTER `end_time`"); |
54 | 58 | } |
55 | 59 | //add view_count index: |
56 | | -if(!$wgDatabase->indexExists('view_count')){ |
| 60 | +if(!$wgDatabase->indexExists('mv_mvd_index','view_count')){ |
57 | 61 | $wgDatabase->query("ALTER TABLE `mv_mvd_index` ADD INDEX ( `view_count` )"); |
58 | 62 | } |
59 | 63 | /*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')){ |
61 | 65 | $wgDatabase->query("ALTER TABLE `mv_mvd_index` DROP INDEX `mvd_type`"); |
62 | 66 | } |
63 | | -if($wgDatabase->indexExists('stream_id')){ |
| 67 | +if($wgDatabase->indexExists('mv_mvd_index','stream_id')){ |
64 | 68 | $wgDatabase->query("ALTER TABLE `mv_mvd_index` DROP INDEX `stream_id`"); |
65 | 69 | } |
66 | | -if($wgDatabase->indexExists('stream_time_start')){ |
| 70 | +if($wgDatabase->indexExists('mv_mvd_index','stream_time_start')){ |
67 | 71 | $wgDatabase->query("ALTER TABLE `mv_mvd_index` DROP INDEX `stream_time_start`"); |
68 | 72 | } |
69 | 73 | //add missing indexes: |
70 | | -if(!$wgDatabase->indexExists('mvd_stream_index')){ |
| 74 | +if(!$wgDatabase->indexExists('mv_mvd_index','mvd_stream_index')){ |
71 | 75 | print "rebuilding mvd index ... this may take \"some time\"\n"; |
72 | 76 | $wgDatabase->query(" ALTER TABLE `mv_mvd_index` ADD INDEX `mvd_stream_index` ( `stream_id` , `start_time` , `end_time` )"); |
73 | 77 | } |
74 | | -if(!$wgDatabase->indexExists('mvd_type_index')){ |
| 78 | +if(!$wgDatabase->indexExists('mv_mvd_index','mvd_type_index')){ |
75 | 79 | $wgDatabase->query(" ALTER TABLE `mv_mvd_index` ADD INDEX `mvd_type_index` (`mvd_type`, `stream_id`)"); |
76 | 80 | } |
77 | 81 | |