Index: trunk/extensions/Drafts/Drafts.hooks.php |
— | — | @@ -9,18 +9,25 @@ |
10 | 10 | class DraftHooks { |
11 | 11 | |
12 | 12 | /* Static Functions */ |
13 | | - public static function schema() { |
14 | | - global $wgExtNewTables, $wgExtModifiedFields; |
| 13 | + public static function schema( $updater = null ) { |
| 14 | + if ( $updater === null ) { |
| 15 | + global $wgExtNewTables, $wgExtModifiedFields; |
15 | 16 | |
16 | | - $wgExtNewTables[] = array( |
17 | | - 'drafts', |
18 | | - dirname( __FILE__ ) . '/Drafts.sql' |
19 | | - ); |
20 | | - $wgExtModifiedFields[] = array( |
21 | | - 'drafts', |
22 | | - 'draft_token', |
23 | | - dirname( __FILE__ ) . '/patch-draft_token.sql' |
24 | | - ); |
| 17 | + $wgExtNewTables[] = array( |
| 18 | + 'drafts', |
| 19 | + dirname( __FILE__ ) . '/Drafts.sql' |
| 20 | + ); |
| 21 | + $wgExtModifiedFields[] = array( |
| 22 | + 'drafts', |
| 23 | + 'draft_token', |
| 24 | + dirname( __FILE__ ) . '/patch-draft_token.sql' |
| 25 | + ); |
| 26 | + } else { |
| 27 | + $updater->addExtensionUpdate( array( 'addTable', 'drafts', |
| 28 | + dirname( __FILE__ ) . '/Drafts.sql', true ) ); |
| 29 | + $updater->addExtensionUpdate( array( 'modifyField', 'drafts', 'draft_token', |
| 30 | + dirname( __FILE__ ) . '/patch-draft_token.sql', true ) ); |
| 31 | + } |
25 | 32 | |
26 | 33 | return true; |
27 | 34 | } |