r62870 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r62869‎ | r62870 | r62871 >
Date:11:24, 23 February 2010
Author:freakolowsky
Status:resolved (Comments)
Tags:schema 
Comment:
Changed all *_mime_minor field lengths to 100; current 32 does not support some OpenDocument mimes
* changed tables.sql for mysql and oracle
* added patch script for mysql and included it in updaters.inc
Modified paths:
  • /trunk/phase3/maintenance/archives/patch-mime_minor_length.sql (added) (history)
  • /trunk/phase3/maintenance/ora/tables.sql (modified) (history)
  • /trunk/phase3/maintenance/tables.sql (modified) (history)
  • /trunk/phase3/maintenance/updaters.inc (modified) (history)

Diff [purge]

Index: trunk/phase3/maintenance/archives/patch-mime_minor_length.sql
@@ -0,0 +1,9 @@
 2+ALTER TABLE /*$wgDBprefix*/filearchive
 3+ MODIFY COLUMN fa_minor_mime varbinary(100) default "unknown";
 4+
 5+ALTER TABLE /*$wgDBprefix*/image
 6+ MODIFY COLUMN img_minor_mime varbinary(100) NOT NULL default "unknown";
 7+
 8+ALTER TABLE /*$wgDBprefix*/oldimage
 9+ MODIFY COLUMN oi_minor_mime varbinary(100) NOT NULL default "unknown";
 10+
Property changes on: trunk/phase3/maintenance/archives/patch-mime_minor_length.sql
___________________________________________________________________
Name: svn:eol-style
111 + native
Index: trunk/phase3/maintenance/ora/tables.sql
@@ -253,7 +253,7 @@
254254 img_bits NUMBER,
255255 img_media_type VARCHAR2(32),
256256 img_major_mime VARCHAR2(32) DEFAULT 'unknown',
257 - img_minor_mime VARCHAR2(32) DEFAULT 'unknown',
 257+ img_minor_mime VARCHAR2(100) DEFAULT 'unknown',
258258 img_description VARCHAR2(255),
259259 img_user NUMBER NULL REFERENCES &mw_prefix.mwuser(user_id) ON DELETE SET NULL,
260260 img_user_text VARCHAR2(255) NOT NULL,
@@ -281,7 +281,7 @@
282282 oi_metadata CLOB,
283283 oi_media_type VARCHAR2(32) DEFAULT NULL,
284284 oi_major_mime VARCHAR2(32) DEFAULT 'unknown',
285 - oi_minor_mime VARCHAR2(32) DEFAULT 'unknown',
 285+ oi_minor_mime VARCHAR2(100) DEFAULT 'unknown',
286286 oi_deleted NUMBER DEFAULT 0 NOT NULL,
287287 oi_sha1 VARCHAR2(32)
288288 );
@@ -308,7 +308,7 @@
309309 fa_bits NUMBER,
310310 fa_media_type VARCHAR2(32) DEFAULT NULL,
311311 fa_major_mime VARCHAR2(32) DEFAULT 'unknown',
312 - fa_minor_mime VARCHAR2(32) DEFAULT 'unknown',
 312+ fa_minor_mime VARCHAR2(100) DEFAULT 'unknown',
313313 fa_description VARCHAR2(255),
314314 fa_user NUMBER NULL REFERENCES &mw_prefix.mwuser(user_id) ON DELETE SET NULL,
315315 fa_user_text VARCHAR2(255) NOT NULL,
Index: trunk/phase3/maintenance/updaters.inc
@@ -194,7 +194,7 @@
195195 array( 'add_index', 'change_tag', 'change_tag_rc_tag', 'patch-change_tag-indexes.sql' ),
196196 array( 'add_field', 'redirect', 'rd_interwiki', 'patch-rd_interwiki.sql' ),
197197 array( 'do_update_transcache_field' ),
198 -
 198+ array( 'do_update_mime_minor_field' ),
199199 // version-independent searchindex setup, added in 1.16
200200 array( 'sqlite_setup_searchindex' ),
201201 ),
@@ -1356,6 +1356,15 @@
13571357 }
13581358 }
13591359
 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" );
 1365+}
 1366+
 1367+
 1368+
13601369 /***********************************************************************
13611370 * Start PG stuff
13621371 * TODO: merge with above
Index: trunk/phase3/maintenance/tables.sql
@@ -764,7 +764,7 @@
765765 -- the minor parts are not required to adher to any standard
766766 -- but should be consistent throughout the database
767767 -- 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",
769769
770770 -- Description field as entered by the uploader.
771771 -- This is displayed in image upload history and logs.
@@ -816,7 +816,7 @@
817817 oi_metadata mediumblob NOT NULL,
818818 oi_media_type ENUM("UNKNOWN", "BITMAP", "DRAWING", "AUDIO", "VIDEO", "MULTIMEDIA", "OFFICE", "TEXT", "EXECUTABLE", "ARCHIVE") default NULL,
819819 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",
821821 oi_deleted tinyint unsigned NOT NULL default 0,
822822 oi_sha1 varbinary(32) NOT NULL default ''
823823 ) /*$wgDBTableOptions*/;
@@ -866,7 +866,7 @@
867867 fa_bits int default 0,
868868 fa_media_type ENUM("UNKNOWN", "BITMAP", "DRAWING", "AUDIO", "VIDEO", "MULTIMEDIA", "OFFICE", "TEXT", "EXECUTABLE", "ARCHIVE") default NULL,
869869 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",
871871 fa_description tinyblob,
872872 fa_user int unsigned default 0,
873873 fa_user_text varchar(255) binary,

Follow-up revisions

RevisionCommit summaryAuthorDate
r62872Fixes for r62870. It still needs a patch for Oracle thoughmaxsem12:24, 23 February 2010
r62877Backport r62870 and r62872freakolowsky14:13, 23 February 2010

Comments

#Comment by MaxSem (talk | contribs)   11:29, 23 February 2010

Will not work for multiple reasons, I'll try to fix.

#Comment by Simetrical (talk | contribs)   21:11, 1 April 2011

Why 100 and not 255?

#Comment by Freakolowsky (talk | contribs)   10:27, 2 April 2011

no specific reason ... 100 seemed enough.

Status & tagging log