Index: trunk/extensions/OpenID/README.OpenID-mediawiki-extension |
— | — | @@ -467,6 +467,7 @@ |
468 | 468 | into that account now |
469 | 469 | |
470 | 470 | == CHANGES == |
| 471 | +* 0.942 code cosmetic db schema updater |
471 | 472 | * 0.940 changed database schema updater; tested for MySQL |
472 | 473 | * 0.939 function name changes |
473 | 474 | * 0.938 list uoi_user_registration timestamp if present in openid-preference tab |
Index: trunk/extensions/OpenID/OpenID.hooks.php |
— | — | @@ -331,10 +331,11 @@ |
332 | 332 | dirname( __FILE__ ) . '/patches/openid_table.sql' |
333 | 333 | ); |
334 | 334 | |
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) |
336 | 337 | $db = wfGetDB( DB_MASTER ); |
337 | 338 | $info = $db->fieldInfo( 'user_openid', 'uoi_user' ); |
338 | | - if ( !$info->isMultipleKey() ) { |
| 339 | + if ( $info && !$info->isMultipleKey() ) { |
339 | 340 | echo( "Making uoi_user field non UNIQUE...\n" ); |
340 | 341 | $db->sourceFile( dirname( __FILE__ ) . '/patches/patch-uoi_user-not-unique.sql' ); |
341 | 342 | echo( " done.\n" ); |
— | — | @@ -350,19 +351,20 @@ |
351 | 352 | ); |
352 | 353 | } else { |
353 | 354 | // >= 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' ); |
356 | 357 | |
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) |
358 | 360 | $db = $updater->getDB(); |
359 | 361 | $info = $db->fieldInfo( 'user_openid', 'uoi_user' ); |
360 | | - if ( !$info->isMultipleKey() ) { |
| 362 | + if ( $info && !$info->isMultipleKey() ) { |
361 | 363 | $updater->addExtensionUpdate( array( 'dropIndex', 'user_openid', 'uoi_user', |
362 | 364 | dirname( __FILE__ ) . '/patches/patch-drop_non_multiple_key_index_uoi_user.sql', true ) ); |
363 | 365 | $updater->addExtensionIndex( 'user_openid', 'user_openid_user', |
364 | 366 | dirname( __FILE__ ) . '/patches/patch-add_multiple_key_index_user_openid_user.sql' ); |
365 | 367 | } |
366 | | - |
| 368 | + |
367 | 369 | # uoi_user_registration field was added in OpenID version 0.937 |
368 | 370 | $updater->addExtensionField( 'user_openid', 'uoi_user_registration', |
369 | 371 | dirname( __FILE__ ) . '/patches/patch-add_uoi_user_registration.sql' ); |
Index: trunk/extensions/OpenID/OpenID.php |
— | — | @@ -27,7 +27,7 @@ |
28 | 28 | exit( 1 ); |
29 | 29 | } |
30 | 30 | |
31 | | -define( 'MEDIAWIKI_OPENID_VERSION', '0.941-beta 20111011' ); |
| 31 | +define( 'MEDIAWIKI_OPENID_VERSION', '0.942-beta 20111012' ); |
32 | 32 | |
33 | 33 | $path = dirname( __FILE__ ); |
34 | 34 | set_include_path( implode( PATH_SEPARATOR, array( $path ) ) . PATH_SEPARATOR . get_include_path() ); |