Index: trunk/phase3/maintenance/archives/patch-mime_minor_length.sql |
— | — | @@ -1,9 +1,10 @@ |
2 | | -ALTER TABLE /*$wgDBprefix*/filearchive |
| 2 | +ALTER TABLE /*_*/filearchive |
3 | 3 | MODIFY COLUMN fa_minor_mime varbinary(100) default "unknown"; |
4 | 4 | |
5 | | -ALTER TABLE /*$wgDBprefix*/image |
| 5 | +ALTER TABLE /*_*/image |
6 | 6 | MODIFY COLUMN img_minor_mime varbinary(100) NOT NULL default "unknown"; |
7 | 7 | |
8 | | -ALTER TABLE /*$wgDBprefix*/oldimage |
| 8 | +ALTER TABLE /*_*/oldimage |
9 | 9 | MODIFY COLUMN oi_minor_mime varbinary(100) NOT NULL default "unknown"; |
10 | 10 | |
| 11 | +INSERT INTO /*_*/updatelog VALUES ('mime_minor_length'); |
\ No newline at end of file |
Index: trunk/phase3/maintenance/updaters.inc |
— | — | @@ -169,6 +169,7 @@ |
170 | 170 | // A field changed name mid-release cycle, so fix it for anyone using |
171 | 171 | // trunk |
172 | 172 | array( 'rename_eu_wiki_id' ), |
| 173 | + array( 'do_update_mime_minor_field' ), |
173 | 174 | ), |
174 | 175 | |
175 | 176 | 'sqlite' => array( |
— | — | @@ -194,7 +195,6 @@ |
195 | 196 | array( 'add_index', 'change_tag', 'change_tag_rc_tag', 'patch-change_tag-indexes.sql' ), |
196 | 197 | array( 'add_field', 'redirect', 'rd_interwiki', 'patch-rd_interwiki.sql' ), |
197 | 198 | array( 'do_update_transcache_field' ), |
198 | | - array( 'do_update_mime_minor_field' ), |
199 | 199 | // version-independent searchindex setup, added in 1.16 |
200 | 200 | array( 'sqlite_setup_searchindex' ), |
201 | 201 | ), |
— | — | @@ -1357,10 +1357,14 @@ |
1358 | 1358 | } |
1359 | 1359 | |
1360 | 1360 | function do_update_mime_minor_field() { |
1361 | | - global $wgDatabase; |
1362 | | - wfOut( "Altering all *_mime_minor fields to 100 bytes in size ... " ); |
1363 | | - $wgDatabase->sourceFile( archive( 'patch-mime_minor_length.sql' ) ); |
1364 | | - wfOut( "ok\n" ); |
| 1361 | + if ( update_row_exists( 'mime_minor_length' ) ) { |
| 1362 | + wfOut( "*_mime_minor fields are already long enough.\n" ); |
| 1363 | + } else { |
| 1364 | + global $wgDatabase; |
| 1365 | + wfOut( "Altering all *_mime_minor fields to 100 bytes in size ... " ); |
| 1366 | + $wgDatabase->sourceFile( archive( 'patch-mime_minor_length.sql' ) ); |
| 1367 | + wfOut( "ok\n" ); |
| 1368 | + } |
1365 | 1369 | } |
1366 | 1370 | |
1367 | 1371 | |