r99665 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r99664‎ | r99665 | r99666 >
Date:00:31, 13 October 2011
Author:wikinaut
Status:deferred
Tags:
Comment:
maintenance patch of the updater hook
Modified paths:
  • /trunk/extensions/OpenID/OpenID.hooks.php (modified) (history)
  • /trunk/extensions/OpenID/OpenID.php (modified) (history)
  • /trunk/extensions/OpenID/README.OpenID-mediawiki-extension (modified) (history)

Diff [purge]

Index: trunk/extensions/OpenID/README.OpenID-mediawiki-extension
@@ -467,6 +467,7 @@
468468 into that account now
469469
470470 == CHANGES ==
 471+* 0.942 code cosmetic db schema updater
471472 * 0.940 changed database schema updater; tested for MySQL
472473 * 0.939 function name changes
473474 * 0.938 list uoi_user_registration timestamp if present in openid-preference tab
Index: trunk/extensions/OpenID/OpenID.hooks.php
@@ -331,10 +331,11 @@
332332 dirname( __FILE__ ) . '/patches/openid_table.sql'
333333 );
334334
335 - # if index of older OpenID version is unique then upgrade and make index non unique
 335+ # when updating an older OpenID version
 336+ # make the index non unique (remove unique index uoi_user, add new index user_openid_user)
336337 $db = wfGetDB( DB_MASTER );
337338 $info = $db->fieldInfo( 'user_openid', 'uoi_user' );
338 - if ( !$info->isMultipleKey() ) {
 339+ if ( $info && !$info->isMultipleKey() ) {
339340 echo( "Making uoi_user field non UNIQUE...\n" );
340341 $db->sourceFile( dirname( __FILE__ ) . '/patches/patch-uoi_user-not-unique.sql' );
341342 echo( " done.\n" );
@@ -350,19 +351,20 @@
351352 );
352353 } else {
353354 // >= 1.17 support
354 - $updater->addExtensionUpdate( array( 'addTable', 'user_openid',
355 - dirname( __FILE__ ) . '/patches/openid_table.sql', true ) );
 355+ $updater->addExtensionTable( 'user_openid',
 356+ dirname( __FILE__ ) . '/patches/openid_table.sql' );
356357
357 - # if index of older OpenID version is unique then upgrade and make index non unique
 358+ # when updating an older OpenID version
 359+ # make the index non unique (remove unique index uoi_user, add new index user_openid_user)
358360 $db = $updater->getDB();
359361 $info = $db->fieldInfo( 'user_openid', 'uoi_user' );
360 - if ( !$info->isMultipleKey() ) {
 362+ if ( $info && !$info->isMultipleKey() ) {
361363 $updater->addExtensionUpdate( array( 'dropIndex', 'user_openid', 'uoi_user',
362364 dirname( __FILE__ ) . '/patches/patch-drop_non_multiple_key_index_uoi_user.sql', true ) );
363365 $updater->addExtensionIndex( 'user_openid', 'user_openid_user',
364366 dirname( __FILE__ ) . '/patches/patch-add_multiple_key_index_user_openid_user.sql' );
365367 }
366 -
 368+
367369 # uoi_user_registration field was added in OpenID version 0.937
368370 $updater->addExtensionField( 'user_openid', 'uoi_user_registration',
369371 dirname( __FILE__ ) . '/patches/patch-add_uoi_user_registration.sql' );
Index: trunk/extensions/OpenID/OpenID.php
@@ -27,7 +27,7 @@
2828 exit( 1 );
2929 }
3030
31 -define( 'MEDIAWIKI_OPENID_VERSION', '0.941-beta 20111011' );
 31+define( 'MEDIAWIKI_OPENID_VERSION', '0.942-beta 20111012' );
3232
3333 $path = dirname( __FILE__ );
3434 set_include_path( implode( PATH_SEPARATOR, array( $path ) ) . PATH_SEPARATOR . get_include_path() );

Status & tagging log