Index: branches/REL1_16/phase3/maintenance/archives/patch-mime_minor_length.sql |
— | — | @@ -0,0 +1,10 @@ |
| 2 | +ALTER TABLE /*_*/filearchive |
| 3 | + MODIFY COLUMN fa_minor_mime varbinary(100) default "unknown"; |
| 4 | + |
| 5 | +ALTER TABLE /*_*/image |
| 6 | + MODIFY COLUMN img_minor_mime varbinary(100) NOT NULL default "unknown"; |
| 7 | + |
| 8 | +ALTER TABLE /*_*/oldimage |
| 9 | + MODIFY COLUMN oi_minor_mime varbinary(100) NOT NULL default "unknown"; |
| 10 | + |
| 11 | +INSERT INTO /*_*/updatelog VALUES ('mime_minor_length'); |
\ No newline at end of file |
Property changes on: branches/REL1_16/phase3/maintenance/archives/patch-mime_minor_length.sql |
___________________________________________________________________ |
Name: svn:eol-style |
1 | 12 | + native |
Index: branches/REL1_16/phase3/maintenance/ora/tables.sql |
— | — | @@ -253,7 +253,7 @@ |
254 | 254 | img_bits NUMBER, |
255 | 255 | img_media_type VARCHAR2(32), |
256 | 256 | img_major_mime VARCHAR2(32) DEFAULT 'unknown', |
257 | | - img_minor_mime VARCHAR2(32) DEFAULT 'unknown', |
| 257 | + img_minor_mime VARCHAR2(100) DEFAULT 'unknown', |
258 | 258 | img_description VARCHAR2(255), |
259 | 259 | img_user NUMBER NULL REFERENCES &mw_prefix.mwuser(user_id) ON DELETE SET NULL, |
260 | 260 | img_user_text VARCHAR2(255) NOT NULL, |
— | — | @@ -281,7 +281,7 @@ |
282 | 282 | oi_metadata CLOB, |
283 | 283 | oi_media_type VARCHAR2(32) DEFAULT NULL, |
284 | 284 | oi_major_mime VARCHAR2(32) DEFAULT 'unknown', |
285 | | - oi_minor_mime VARCHAR2(32) DEFAULT 'unknown', |
| 285 | + oi_minor_mime VARCHAR2(100) DEFAULT 'unknown', |
286 | 286 | oi_deleted NUMBER DEFAULT 0 NOT NULL, |
287 | 287 | oi_sha1 VARCHAR2(32) |
288 | 288 | ); |
— | — | @@ -308,7 +308,7 @@ |
309 | 309 | fa_bits NUMBER, |
310 | 310 | fa_media_type VARCHAR2(32) DEFAULT NULL, |
311 | 311 | fa_major_mime VARCHAR2(32) DEFAULT 'unknown', |
312 | | - fa_minor_mime VARCHAR2(32) DEFAULT 'unknown', |
| 312 | + fa_minor_mime VARCHAR2(100) DEFAULT 'unknown', |
313 | 313 | fa_description VARCHAR2(255), |
314 | 314 | fa_user NUMBER NULL REFERENCES &mw_prefix.mwuser(user_id) ON DELETE SET NULL, |
315 | 315 | fa_user_text VARCHAR2(255) NOT NULL, |
Index: branches/REL1_16/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 | | - |
199 | 199 | // version-independent searchindex setup, added in 1.16 |
200 | 200 | array( 'sqlite_setup_searchindex' ), |
201 | 201 | ), |
— | — | @@ -1356,6 +1356,19 @@ |
1357 | 1357 | } |
1358 | 1358 | } |
1359 | 1359 | |
| 1360 | +function do_update_mime_minor_field() { |
| 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 | + } |
| 1369 | +} |
| 1370 | + |
| 1371 | + |
| 1372 | + |
1360 | 1373 | /*********************************************************************** |
1361 | 1374 | * Start PG stuff |
1362 | 1375 | * TODO: merge with above |
Index: branches/REL1_16/phase3/maintenance/tables.sql |
— | — | @@ -764,7 +764,7 @@ |
765 | 765 | -- the minor parts are not required to adher to any standard |
766 | 766 | -- but should be consistent throughout the database |
767 | 767 | -- see http://www.iana.org/assignments/media-types/ |
768 | | - img_minor_mime varbinary(32) NOT NULL default "unknown", |
| 768 | + img_minor_mime varbinary(100) NOT NULL default "unknown", |
769 | 769 | |
770 | 770 | -- Description field as entered by the uploader. |
771 | 771 | -- This is displayed in image upload history and logs. |
— | — | @@ -816,7 +816,7 @@ |
817 | 817 | oi_metadata mediumblob NOT NULL, |
818 | 818 | oi_media_type ENUM("UNKNOWN", "BITMAP", "DRAWING", "AUDIO", "VIDEO", "MULTIMEDIA", "OFFICE", "TEXT", "EXECUTABLE", "ARCHIVE") default NULL, |
819 | 819 | oi_major_mime ENUM("unknown", "application", "audio", "image", "text", "video", "message", "model", "multipart") NOT NULL default "unknown", |
820 | | - oi_minor_mime varbinary(32) NOT NULL default "unknown", |
| 820 | + oi_minor_mime varbinary(100) NOT NULL default "unknown", |
821 | 821 | oi_deleted tinyint unsigned NOT NULL default 0, |
822 | 822 | oi_sha1 varbinary(32) NOT NULL default '' |
823 | 823 | ) /*$wgDBTableOptions*/; |
— | — | @@ -866,7 +866,7 @@ |
867 | 867 | fa_bits int default 0, |
868 | 868 | fa_media_type ENUM("UNKNOWN", "BITMAP", "DRAWING", "AUDIO", "VIDEO", "MULTIMEDIA", "OFFICE", "TEXT", "EXECUTABLE", "ARCHIVE") default NULL, |
869 | 869 | fa_major_mime ENUM("unknown", "application", "audio", "image", "text", "video", "message", "model", "multipart") default "unknown", |
870 | | - fa_minor_mime varbinary(32) default "unknown", |
| 870 | + fa_minor_mime varbinary(100) default "unknown", |
871 | 871 | fa_description tinyblob, |
872 | 872 | fa_user int unsigned default 0, |
873 | 873 | fa_user_text varchar(255) binary, |