Index: trunk/extensions/PrefSwitch/PrefSwitch.hooks.php |
— | — | @@ -23,12 +23,18 @@ |
24 | 24 | /* |
25 | 25 | * LoadExtensionSchemaUpdates hook |
26 | 26 | */ |
27 | | - public static function loadExtensionSchemaUpdates() { |
28 | | - global $wgExtNewTables, $wgExtNewFields; |
29 | | - |
| 27 | + public static function loadExtensionSchemaUpdates( $updater = null ) { |
30 | 28 | $dir = dirname( __FILE__ ) . '/patches'; |
31 | | - $wgExtNewTables[] = array( 'prefswitch_survey', $dir . '/PrefSwitch.sql' ); |
32 | | - $wgExtNewFields[] = array( 'prefswitch_survey', 'pss_user_text', $dir . '/PrefSwitch-addusertext.sql' ); |
| 29 | + if ( $updater === null ) { |
| 30 | + global $wgExtNewTables, $wgExtNewFields; |
| 31 | + $wgExtNewTables[] = array( 'prefswitch_survey', $dir . '/PrefSwitch.sql' ); |
| 32 | + $wgExtNewFields[] = array( 'prefswitch_survey', 'pss_user_text', $dir . '/PrefSwitch-addusertext.sql' ); |
| 33 | + } else { |
| 34 | + $updater->addExtensionUpdate( array( 'addTable', 'prefswitch_survey', |
| 35 | + $dir . '/PrefSwitch.sql', true ) ); |
| 36 | + $updater->addExtensionUpdate( array( 'addField', 'prefswitch_survey', |
| 37 | + 'pss_user_text', $dir . '/PrefSwitch-addusertext.sql', true ) ); |
| 38 | + } |
33 | 39 | return true; |
34 | 40 | } |
35 | 41 | |