Index: trunk/phase3/maintenance/archives/patch-oi_metadata.sql |
— | — | @@ -0,0 +1,16 @@ |
| 2 | +--
|
| 3 | +-- patch-indexes.sql
|
| 4 | +--
|
| 5 | +-- Add data to allow for direct reference to old images
|
| 6 | +-- They can be included into pages
|
| 7 | +--
|
| 8 | +
|
| 9 | +ALTER TABLE /*$wgDBprefix*/oldimage
|
| 10 | + DROP INDEX oi_name,
|
| 11 | + ADD INDEX oi_name_timestamp (oi_name,oi_timestamp),
|
| 12 | + ADD INDEX oi_name_archive_name (oi_name,oi_archive_name),
|
| 13 | + ADD oi_metadata mediumblob NOT NULL,
|
| 14 | + ADD oi_media_type ENUM("UNKNOWN", "BITMAP", "DRAWING", "AUDIO", "VIDEO", "MULTIMEDIA", "OFFICE", "TEXT", "EXECUTABLE", "ARCHIVE") default NULL,
|
| 15 | + ADD oi_major_mime ENUM("unknown", "application", "audio", "image", "text", "video", "message", "model", "multipart") NOT NULL default "unknown",
|
| 16 | + ADD oi_minor_mime varchar(32) NOT NULL default "unknown",
|
| 17 | + ADD oi_deleted tinyint(1) unsigned NOT NULL default '0', |
\ No newline at end of file |
Index: trunk/phase3/maintenance/ora/tables.sql |
— | — | @@ -244,9 +244,15 @@ |
245 | 245 | oi_description CLOB, |
246 | 246 | oi_user INTEGER NULL REFERENCES mwuser(user_id) ON DELETE SET NULL, |
247 | 247 | oi_user_text CLOB NOT NULL, |
248 | | - oi_timestamp TIMESTAMP WITH TIME ZONE 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 |
249 | 254 | ); |
250 | | -CREATE INDEX oi_name ON oldimage (oi_name); |
| 255 | +CREATE INDEX oi_name_timestamp ON oldimage (oi_name,oi_timestamp); |
| 256 | +CREATE INDEX oi_name_archive_name ON oldimage (oi_name,oi_archive_name); |
251 | 257 | |
252 | 258 | CREATE SEQUENCE filearchive_fa_id_seq; |
253 | 259 | CREATE TABLE filearchive ( |
Index: trunk/phase3/maintenance/postgres/tables.sql |
— | — | @@ -262,9 +262,15 @@ |
263 | 263 | oi_description TEXT, |
264 | 264 | oi_user INTEGER NULL REFERENCES mwuser(user_id) ON DELETE SET NULL, |
265 | 265 | oi_user_text TEXT NOT NULL, |
266 | | - oi_timestamp TIMESTAMPTZ 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' |
267 | 272 | ); |
268 | | -CREATE INDEX oi_name ON oldimage (oi_name); |
| 273 | +CREATE INDEX oi_name_timestamp ON oldimage (oi_name,oi_timestamp); |
| 274 | +CREATE INDEX oi_name_archive_name ON oldimage (oi_name,oi_archive_name); |
269 | 275 | |
270 | 276 | |
271 | 277 | CREATE TABLE filearchive ( |
Index: trunk/phase3/maintenance/tables.sql |
— | — | @@ -716,7 +716,14 @@ |
717 | 717 | oi_user_text varchar(255) binary NOT NULL, |
718 | 718 | oi_timestamp char(14) binary NOT NULL default '', |
719 | 719 | |
720 | | - INDEX oi_name (oi_name(10)) |
| 720 | + oi_metadata mediumblob NOT NULL, |
| 721 | + oi_media_type ENUM("UNKNOWN", "BITMAP", "DRAWING", "AUDIO", "VIDEO", "MULTIMEDIA", "OFFICE", "TEXT", "EXECUTABLE", "ARCHIVE") default NULL, |
| 722 | + oi_major_mime ENUM("unknown", "application", "audio", "image", "text", "video", "message", "model", "multipart") NOT NULL default "unknown", |
| 723 | + oi_minor_mime varchar(32) NOT NULL default "unknown", |
| 724 | + oi_deleted tinyint(1) unsigned NOT NULL default '0', |
| 725 | + |
| 726 | + INDEX oi_name_timestamp (oi_name,oi_timestamp), |
| 727 | + INDEX oi_name_archive_name (oi_name,oi_archive_name) |
721 | 728 | |
722 | 729 | ) /*$wgDBTableOptions*/; |
723 | 730 | |