r110659 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r110658‎ | r110659 | r110660 >
Date:14:55, 3 February 2012
Author:maxsem
Status:ok
Tags:
Comment:
Follow-up r110649: fix SQL file, SQLite support (tested, but not extensively)
Modified paths:
  • /trunk/extensions/GeoData/GeoData.sql (modified) (history)
  • /trunk/extensions/GeoData/GeoDataHooks.php (modified) (history)

Diff [purge]

Index: trunk/extensions/GeoData/GeoData.sql
@@ -33,4 +33,4 @@
3434
3535 CREATE INDEX /*i*/gt_page_id ON /*_*/geo_tags ( gt_page_id );
3636 CREATE INDEX /*i*/gt_id_page_id ON /*_*/geo_tags ( gt_page_id, gt_id );
37 -CREATE INDEX /*i*/gt_spatial ON /*_*/geo_tags ( gt_lati, gt_loni, gt_lon );
 37+CREATE INDEX /*i*/gt_spatial ON /*_*/geo_tags ( gt_lat_int, gt_lon_int, gt_lon );
Index: trunk/extensions/GeoData/GeoDataHooks.php
@@ -7,10 +7,14 @@
88 * @param DatabaseUpdater $updater
99 */
1010 public static function onLoadExtensionSchemaUpdates( DatabaseUpdater $updater ) {
11 - if ( $updater->getDB()->getType() != 'mysql' ) {
12 - throw new MWException( 'GeoData extension currently supports only MySQL' );
 11+ switch ( $updater->getDB()->getType() ) {
 12+ case 'mysql':
 13+ case 'sqlite':
 14+ $updater->addExtensionTable( 'geo_tags', dirname( __FILE__ ) . '/GeoData.sql' );
 15+ break;
 16+ default:
 17+ throw new MWException( 'GeoData extension currently supports only MySQL and SQLite' );
1318 }
14 - $updater->addExtensionTable( 'geo_tags', dirname( __FILE__ ) . '/GeoData.sql' );
1519 return true;
1620 }
1721

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r110649DB schema revamp based on discussion with Ashermaxsem10:18, 3 February 2012

Status & tagging log