r21957 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r21956‎ | r21957 | r21958 >
Date:16:24, 7 May 2007
Author:brion
Status:old
Tags:
Comment:
Revert schema changes in r21954, 21955, 21956 for the moment
Modified paths:
  • /trunk/phase3/maintenance/archives/patch-oi_metadata.sql (deleted) (history)
  • /trunk/phase3/maintenance/ora/tables.sql (modified) (history)
  • /trunk/phase3/maintenance/postgres/tables.sql (modified) (history)
  • /trunk/phase3/maintenance/rebuildImages.php (modified) (history)
  • /trunk/phase3/maintenance/tables.sql (modified) (history)
  • /trunk/phase3/maintenance/updaters.inc (modified) (history)

Diff [purge]

Index: trunk/phase3/maintenance/archives/patch-oi_metadata.sql
@@ -1,15 +0,0 @@
2 -
3 -ALTER TABLE /*$wgDBprefix*/oldimage
4 - DROP INDEX oi_name,
5 - ADD INDEX oi_name_timestamp (oi_name,oi_timestamp),
6 - ADD oi_metadata mediumblob NOT NULL,
7 - ADD oi_media_type ENUM("UNKNOWN", "BITMAP", "DRAWING", "AUDIO", "VIDEO", "MULTIMEDIA", "OFFICE", "TEXT", "EXECUTABLE", "ARCHIVE") default NULL,
8 - ADD oi_major_mime ENUM("unknown", "application", "audio", "image", "text", "video", "message", "model", "multipart") NOT NULL default "unknown",
9 - ADD oi_minor_mime varchar(32) NOT NULL default "unknown",
10 - ADD oi_deleted tinyint(1) unsigned NOT NULL default '0',
\ No newline at end of file
Index: trunk/phase3/maintenance/ora/tables.sql
@@ -244,12 +244,7 @@
245245 oi_description CLOB,
246246 oi_user INTEGER NULL REFERENCES mwuser(user_id) ON DELETE SET NULL,
247247 oi_user_text CLOB NOT NULL,
248 - oi_timestamp TIMESTAMP WITH TIME ZONE NOT NULL,
249 - oi_metadata CLOB,
250 - oi_media_type VARCHAR(10) DEFAULT NULL,
251 - oi_major_mime VARCHAR(11) DEFAULT 'unknown',
252 - oi_minor_mime VARCHAR(32) DEFAULT 'unknown',
253 - oi_deleted INTEGER DEFAULT 0 NOT NULL
 248+ oi_timestamp TIMESTAMP WITH TIME ZONE NOT NULL
254249 );
255250 CREATE INDEX oi_name ON oldimage (oi_name);
256251
Index: trunk/phase3/maintenance/postgres/tables.sql
@@ -262,12 +262,7 @@
263263 oi_description TEXT,
264264 oi_user INTEGER NULL REFERENCES mwuser(user_id) ON DELETE SET NULL,
265265 oi_user_text TEXT NOT NULL,
266 - oi_timestamp TIMESTAMPTZ NOT NULL,
267 - oi_metadata BYTEA NOT NULL,
268 - oi_media_type TEXT NULL,
269 - oi_major_mime TEXT NOT NULL DEFAULT 'unknown',
270 - oi_minor_mime TEXT NOT NULL DEFAULT 'unknown',
271 - oi_deleted CHAR NOT NULL DEFAULT '0'
 266+ oi_timestamp TIMESTAMPTZ NOT NULL
272267 );
273268 CREATE INDEX oi_name ON oldimage (oi_name);
274269
Index: trunk/phase3/maintenance/updaters.inc
@@ -76,7 +76,6 @@
7777 array( 'archive', 'ar_len', 'patch-ar_len.sql' ),
7878 array( 'revision', 'rev_parent_id', 'patch-rev_parent_id.sql' ),
7979 array( 'page_restrictions', 'pr_id', 'patch-page_restrictions_sortkey.sql' ),
80 - array( 'oldimage', 'oi_metadata', 'patch-oi_metadata.sql' ),
8180 );
8281
8382 function rename_table( $from, $to, $patch ) {
@@ -1196,11 +1195,6 @@
11971196 array("logging", "log_params", "TEXT"),
11981197 array("mwuser", "user_editcount", "INTEGER"),
11991198 array("mwuser", "user_newpass_time", "TIMESTAMPTZ"),
1200 - array("oldimage", "oi_metadata", "BYTEA NOT NULL"),
1201 - array("oldimage", "oi_media_type", "TEXT NOT NULL"),
1202 - array("oldimage", "oi_major_mime", "TEXT NOT NULL DEFAULT 'unknown'"),
1203 - array("oldimage", "oi_minor_mime", "TEXT NOT NULL DEFAULT 'unknown'"),
1204 - array("oldimage", "oi_deleted", "CHAR NOT NULL DEFAULT '0'"),
12051199 array("page_restrictions", "pr_id", "INTEGER NOT NULL UNIQUE DEFAULT nextval('pr_id_val')"),
12061200 array("recentchanges", "rc_deleted", "INTEGER NOT NULL DEFAULT 0"),
12071201 array("recentchanges", "rc_log_action", "TEXT"),
Index: trunk/phase3/maintenance/rebuildImages.php
@@ -144,7 +144,7 @@
145145 }
146146
147147 function oldimageCallback( $row ) {
148 - if( $row->oi_width && $row->oi_media_type ) {
 148+ if( $row->oi_width ) {
149149 return null;
150150 }
151151
@@ -153,11 +153,7 @@
154154 return array(
155155 'oi_width' => $info['width' ],
156156 'oi_height' => $info['height'],
157 - 'oi_bits' => $info['bits' ],
158 - 'oi_metadata' => '', // filled in on-demand
159 - 'oi_media_type' => $info['media'],
160 - 'oi_major_mime' => $info['major'],
161 - 'oi_minor_mime' => $info['minor'] );
 157+ 'oi_bits' => $info['bits' ] );
162158 }
163159
164160 function crawlMissing() {
Index: trunk/phase3/maintenance/tables.sql
@@ -715,21 +715,6 @@
716716 oi_user int(5) unsigned NOT NULL default '0',
717717 oi_user_text varchar(255) binary NOT NULL,
718718 oi_timestamp char(14) binary NOT NULL default '',
719 -
720 - -- Extracted EXIF metadata stored as a serialized PHP array.
721 - oi_metadata mediumblob NOT NULL,
722 - -- Media type as defined by the MEDIATYPE_xxx constants
723 - oi_media_type ENUM("UNKNOWN", "BITMAP", "DRAWING", "AUDIO", "VIDEO", "MULTIMEDIA", "OFFICE", "TEXT", "EXECUTABLE", "ARCHIVE") default NULL,
724 - -- major part of a MIME media type as defined by IANA
725 - -- see http://www.iana.org/assignments/media-types/
726 - oi_major_mime ENUM("unknown", "application", "audio", "image", "text", "video", "message", "model", "multipart") NOT NULL default "unknown",
727 - -- minor part of a MIME media type as defined by IANA
728 - -- the minor parts are not required to adher to any standard
729 - -- but should be consistent throughout the database
730 - -- see http://www.iana.org/assignments/media-types/
731 - oi_minor_mime varchar(32) NOT NULL default "unknown",
732 -
733 - oi_deleted tinyint(1) unsigned NOT NULL default '0',
734719
735720 INDEX oi_name (oi_name(10))
736721

Follow-up revisions

RevisionCommit summaryAuthorDate
r22597*Restore oldimage schema changes removed temporarily in r21957 (with some ind...aaron15:26, 31 May 2007
r22619Merged revisions 22587-22618 via svnmerge from...david04:13, 1 June 2007

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r21954*Add new oldimage columns for mime/mediatype info and oi_deleted field. Make ...aaron14:44, 7 May 2007