Index: trunk/extensions/CentralNotice/CentralNotice.php |
— | — | @@ -112,16 +112,26 @@ |
113 | 113 | } |
114 | 114 | } |
115 | 115 | |
116 | | -function efCentralNoticeSchema() { |
117 | | - global $wgDBtype, $wgExtNewTables, $wgExtNewFields; |
118 | | - |
| 116 | +function efCentralNoticeSchema( $updater = null ) { |
119 | 117 | $base = dirname( __FILE__ ); |
120 | | - if ( $wgDBtype == 'mysql' ) { |
121 | | - $wgExtNewTables[] = array( 'cn_notices', $base . '/CentralNotice.sql' ); |
122 | | - $wgExtNewFields[] = array( 'cn_notices', 'not_preferred', $base . '/patches/patch-notice_preferred.sql' ); |
123 | | - $wgExtNewTables[] = array( 'cn_notice_languages', $base . '/patches/patch-notice_languages.sql' ); |
124 | | - $wgExtNewFields[] = array( 'cn_templates', 'tmp_display_anon', $base . '/patches/patch-template_settings.sql' ); |
125 | | - $wgExtNewTables[] = array( 'cn_notice_countries', $base . '/patches/patch-notice_countries.sql' ); |
| 118 | + if ( $updater === null ) { |
| 119 | + global $wgDBtype, $wgExtNewTables, $wgExtNewFields; |
| 120 | + |
| 121 | + if ( $wgDBtype == 'mysql' ) { |
| 122 | + $wgExtNewTables[] = array( 'cn_notices', $base . '/CentralNotice.sql' ); |
| 123 | + $wgExtNewFields[] = array( 'cn_notices', 'not_preferred', $base . '/patches/patch-notice_preferred.sql' ); |
| 124 | + $wgExtNewTables[] = array( 'cn_notice_languages', $base . '/patches/patch-notice_languages.sql' ); |
| 125 | + $wgExtNewFields[] = array( 'cn_templates', 'tmp_display_anon', $base . '/patches/patch-template_settings.sql' ); |
| 126 | + $wgExtNewTables[] = array( 'cn_notice_countries', $base . '/patches/patch-notice_countries.sql' ); |
| 127 | + } |
| 128 | + } else { |
| 129 | + if ( $updater->getDB()->getType() == 'mysql' ) { |
| 130 | + $updater->addExtensionUpdate( array( 'addTable', 'cn_notices', $base . '/CentralNotice.sql' ) ); |
| 131 | + $updater->addExtensionUpdate( array( 'addField', 'cn_notices', 'not_preferred', $base . '/patches/patch-notice_preferred.sql' ) ); |
| 132 | + $updater->addExtensionUpdate( array( 'addTable', 'cn_notice_languages', $base . '/patches/patch-notice_languages.sql' ) ); |
| 133 | + $updater->addExtensionUpdate( array( 'addField', 'cn_templates', 'tmp_display_anon', $base . '/patches/patch-template_settings.sql' ) ); |
| 134 | + $updater->addExtensionUpdate( array( 'addTable', 'cn_notice_countries', $base . '/patches/patch-notice_countries.sql' ) ); |
| 135 | + } |
126 | 136 | } |
127 | 137 | return true; |
128 | 138 | } |