Manual:oldimage table

From MediaWiki.org
Jump to: navigation, search
Language:Project:Language policy English  • 日本語
Manual:ContentsManual:Contents MediaWiki database layoutManual:Database layout oldimage table


This table holds information about old revisions of files. It will be filled when one uploads a new version of an existing file to the wiki. These files are moved to the folder /image/archive. Information on deleted images however will not be stored in the oldimage table; on deletion information is moved to the filearchive instead.

See also: Filearchive table

Fields[edit]

oi_name[edit]

Name of the image (file and article, seems to be the same). Comparable to img_name.

oi_archive_name[edit]

Name of the image, prefixed by a timestamp of the time where it became an old revision

oi_size[edit]

File size in bytes. Comparable to img_size.

oi_width[edit]

Image width, in pixels. Comparable to img_width.

oi_height[edit]

Image height, in pixels. Comparable to img_height.

oi_bits[edit]

Bit-depth of GIF/PNG palette-based images (up to 16-bit). Non-palette images (JPEG/PNG/TIFF/SVG) are 0 or 8. All other files default to 0. img_bits.

oi_description[edit]

Description field given during upload. It's not the description page (associated File: wiki page), but the "summary" provided by the user in case of reupload. Comparable to img_description.

oi_user[edit]

User ID of the user who uploaded the file. Comparable to img_user.

oi_user_text[edit]

Name of original uploader. Comparable to img_user_text.

oi_timestamp[edit]

Timestamp of original file upload. Comparable to img_timestamp.

oi_metadata[edit]

Serialized PHP array of the file's properties. Comparable to img_metadata.

oi_media_type[edit]

Possibilities are UNKNOWN, BITMAP, DRAWING, AUDIO, VIDEO, MULTIMEDIA, OFFICE, TEXT, EXECUTABLE, and ARCHIVE. Comparable to img_media_type.

oi_major_mime[edit]

Possibilities are unknown, application, audio, chemical, image, message, model, multipart, text, and video. Comparable to img_major_mime.

oi_minor_mime[edit]

E.g. jpeg, gif, png, etc. Comparable to img_minor_mime.

oi_deleted[edit]

revdeleted

oi_sha1[edit]

The SHA-1 hash of the file contents in base 36 format. includes/GlobalFunctions.php's wfBaseConvert is used to convert from base 16 (hexadecimal) to base 36 and then pad the result to 31 characters. Comparable to img_sha1.

Schema summary[edit]

MediaWiki version: 1.25

DESCRIBE oldimage;

 +-----------------+--------------------------------------------------------------------------------------------------------+------+-----+---------+-------+
 | Field           | Type                                                                                                   | Null | Key | Default | Extra |
 +-----------------+--------------------------------------------------------------------------------------------------------+------+-----+---------+-------+
 | oi_name         | varchar(255) binary                                                                                    | NO   | MUL | NULL    |       |
 | oi_archive_name | varchar(255) binary                                                                                    | NO   |     | NULL    |       |
 | oi_size         | int(8) unsigned                                                                                        | NO   |     | 0       |       |
 | oi_width        | int(5)                                                                                                 | NO   |     | 0       |       |
 | oi_height       | int(5)                                                                                                 | NO   |     | 0       |       |
 | oi_bits         | int(3)                                                                                                 | NO   |     | 0       |       |
 | oi_description  | varbinary(767)                                                                                         | NO   |     | NULL    |       |
 | oi_user         | int(5) unsigned                                                                                        | NO   |     | 0       |       |
 | oi_user_text    | varchar(255) binary                                                                                    | NO   | MUL | NULL    |       |
 | oi_timestamp    | binary(14)                                                                                             | NO   |     | NULL    |       |
 | oi_metadata     | mediumblob                                                                                             | NO   |     | NULL    |       |
 | oi_media_type   | ENUM('UNKNOWN','BITMAP','DRAWING','AUDIO','VIDEO','MULTIMEDIA','OFFICE','TEXT','EXECUTABLE','ARCHIVE') | YES  |     | NULL    |       |
 | oi_major_mime   | ENUM('unknown','application','audio','image','text','video','message','model','multipart','chemical')  | NO   |     | unknown |       |
 | oi_minor_mime   | varbinary(100)                                                                                         | NO   |     | unknown |       |
 | oi_deleted      | tinyint(3) unsigned                                                                                    | NO   |     | 0       |       |
 | oi_sha1         | varbinary(32)                                                                                          | NO   | MUL | NULL    |       |
 +-----------------+--------------------------------------------------------------------------------------------------------+------+-----+---------+-------+


MediaWiki version: 1.24

DESCRIBE oldimage;

 +-----------------+--------------------------------------------------------------------------------------------------------+------+-----+---------+-------+
 | Field           | Type                                                                                                   | Null | Key | Default | Extra |
 +-----------------+--------------------------------------------------------------------------------------------------------+------+-----+---------+-------+
 | oi_name         | varchar(255) binary                                                                                    | NO   | MUL | NULL    |       |
 | oi_archive_name | varchar(255) binary                                                                                    | NO   |     | NULL    |       |
 | oi_size         | int(8) unsigned                                                                                        | NO   |     | 0       |       |
 | oi_width        | int(5)                                                                                                 | NO   |     | 0       |       |
 | oi_height       | int(5)                                                                                                 | NO   |     | 0       |       |
 | oi_bits         | int(3)                                                                                                 | NO   |     | 0       |       |
 | oi_description  | tinyblob                                                                                               | NO   |     | NULL    |       |
 | oi_user         | int(5) unsigned                                                                                        | NO   |     | 0       |       |
 | oi_user_text    | varchar(255) binary                                                                                    | NO   | MUL | NULL    |       |
 | oi_timestamp    | binary(14)                                                                                             | NO   |     | NULL    |       |
 | oi_metadata     | mediumblob                                                                                             | NO   |     | NULL    |       |
 | oi_media_type   | ENUM('UNKNOWN','BITMAP','DRAWING','AUDIO','VIDEO','MULTIMEDIA','OFFICE','TEXT','EXECUTABLE','ARCHIVE') | YES  |     | NULL    |       |
 | oi_major_mime   | ENUM('unknown','application','audio','image','text','video','message','model','multipart','chemical')  | NO   |     | unknown |       |
 | oi_minor_mime   | varbinary(100)                                                                                         | NO   |     | unknown |       |
 | oi_deleted      | tinyint(3) unsigned                                                                                    | NO   |     | 0       |       |
 | oi_sha1         | varbinary(32)                                                                                          | NO   | MUL | NULL    |       |
 +-----------------+--------------------------------------------------------------------------------------------------------+------+-----+---------+-------+


MediaWiki versions: 1.16 – 1.23

DESCRIBE oldimage;

 +-----------------+--------------------------------------------------------------------------------------------------------+------+-----+---------+-------+
 | Field           | Type                                                                                                   | Null | Key | Default | Extra |
 +-----------------+--------------------------------------------------------------------------------------------------------+------+-----+---------+-------+
 | oi_name         | varchar(255) binary                                                                                    | NO   | MUL | NULL    |       |
 | oi_archive_name | varchar(255) binary                                                                                    | NO   |     | NULL    |       |
 | oi_size         | int(8) unsigned                                                                                        | NO   |     | 0       |       |
 | oi_width        | int(5)                                                                                                 | NO   |     | 0       |       |
 | oi_height       | int(5)                                                                                                 | NO   |     | 0       |       |
 | oi_bits         | int(3)                                                                                                 | NO   |     | 0       |       |
 | oi_description  | tinyblob                                                                                               | NO   |     | NULL    |       |
 | oi_user         | int(5) unsigned                                                                                        | NO   |     | 0       |       |
 | oi_user_text    | varchar(255) binary                                                                                    | NO   | MUL | NULL    |       |
 | oi_timestamp    | binary(14)                                                                                             | NO   |     | NULL    |       |
 | oi_metadata     | mediumblob                                                                                             | NO   |     | NULL    |       |
 | oi_media_type   | ENUM('UNKNOWN','BITMAP','DRAWING','AUDIO','VIDEO','MULTIMEDIA','OFFICE','TEXT','EXECUTABLE','ARCHIVE') | YES  |     | NULL    |       |
 | oi_major_mime   | ENUM('unknown','application','audio','image','text','video','message','model','multipart')             | NO   |     | unknown |       |
 | oi_minor_mime   | varbinary(100)                                                                                         | NO   |     | unknown |       |
 | oi_deleted      | tinyint(3) unsigned                                                                                    | NO   |     | 0       |       |
 | oi_sha1         | varbinary(32)                                                                                          | NO   | MUL | NULL    |       |
 +-----------------+--------------------------------------------------------------------------------------------------------+------+-----+---------+-------+


MediaWiki versions: 1.11 – 1.15

DESCRIBE oldimage;

 +-----------------+--------------------------------------------------------------------------------------------------------+------+-----+---------+-------+
 | Field           | Type                                                                                                   | Null | Key | Default | Extra |
 +-----------------+--------------------------------------------------------------------------------------------------------+------+-----+---------+-------+
 | oi_name         | varchar(255) binary                                                                                    | NO   | MUL | NULL    |       |
 | oi_archive_name | varchar(255) binary                                                                                    | NO   |     | NULL    |       |
 | oi_size         | int(8) unsigned                                                                                        | NO   |     | 0       |       |
 | oi_width        | int(5)                                                                                                 | NO   |     | 0       |       |
 | oi_height       | int(5)                                                                                                 | NO   |     | 0       |       |
 | oi_bits         | int(3)                                                                                                 | NO   |     | 0       |       |
 | oi_description  | tinyblob                                                                                               | NO   |     | NULL    |       |
 | oi_user         | int(5) unsigned                                                                                        | NO   |     | 0       |       |
 | oi_user_text    | varchar(255) binary                                                                                    | NO   | MUL | NULL    |       |
 | oi_timestamp    | binary(14)                                                                                             | NO   |     | NULL    |       |
 | oi_metadata     | mediumblob                                                                                             | NO   |     | NULL    |       |
 | oi_media_type   | ENUM('UNKNOWN','BITMAP','DRAWING','AUDIO','VIDEO','MULTIMEDIA','OFFICE','TEXT','EXECUTABLE','ARCHIVE') | YES  |     | NULL    |       |
 | oi_major_mime   | ENUM('unknown','application','audio','image','text','video','message','model','multipart')             | NO   |     | unknown |       |
 | oi_minor_mime   | varbinary(32)                                                                                          | NO   |     | unknown |       |
 | oi_deleted      | tinyint(3) unsigned                                                                                    | NO   |     | 0       |       |
 | oi_sha1         | varbinary(32)                                                                                          | NO   | MUL | NULL    |       |
 +-----------------+--------------------------------------------------------------------------------------------------------+------+-----+---------+-------+


MediaWiki version: 1.10

DESCRIBE oldimage;

 +-----------------+---------------------+------+-----+---------+-------+
 | Field           | Type                | Null | Key | Default | Extra |
 +-----------------+---------------------+------+-----+---------+-------+
 | oi_name         | varchar(255) binary | NO   | MUL | NULL    |       |
 | oi_archive_name | varchar(255) binary | NO   |     | NULL    |       |
 | oi_size         | int(8) unsigned     | NO   |     | 0       |       |
 | oi_width        | int(5)              | NO   |     | 0       |       |
 | oi_height       | int(5)              | NO   |     | 0       |       |
 | oi_bits         | int(3)              | NO   |     | 0       |       |
 | oi_description  | tinyblob            | NO   |     | NULL    |       |
 | oi_user         | int(5) unsigned     | NO   |     | 0       |       |
 | oi_user_text    | varchar(255) binary | NO   |     | NULL    |       |
 | oi_timestamp    | binary(14)          | NO   |     | NULL    |       |
 +-----------------+---------------------+------+-----+---------+-------+


MediaWiki versions: 1.5 – 1.9

DESCRIBE oldimage;

 +-----------------+---------------------+------+-----+---------+-------+
 | Field           | Type                | Null | Key | Default | Extra |
 +-----------------+---------------------+------+-----+---------+-------+
 | oi_name         | varchar(255) binary | NO   | MUL | NULL    |       |
 | oi_archive_name | varchar(255) binary | NO   |     | NULL    |       |
 | oi_size         | int(8) unsigned     | NO   |     | 0       |       |
 | oi_width        | int(5)              | NO   |     | 0       |       |
 | oi_height       | int(5)              | NO   |     | 0       |       |
 | oi_bits         | int(3)              | NO   |     | 0       |       |
 | oi_description  | tinyblob            | NO   |     | NULL    |       |
 | oi_user         | int(5) unsigned     | NO   |     | 0       |       |
 | oi_user_text    | varchar(255) binary | NO   |     | NULL    |       |
 | oi_timestamp    | char(14) binary     | NO   |     | NULL    |       |
 +-----------------+---------------------+------+-----+---------+-------+


MediaWiki versions: 1.1 – 1.4

DESCRIBE oldimage;

 +-----------------+---------------------+------+-----+---------+-------+
 | Field           | Type                | Null | Key | Default | Extra |
 +-----------------+---------------------+------+-----+---------+-------+
 | oi_name         | varchar(255) binary | NO   | MUL | NULL    |       |
 | oi_archive_name | varchar(255) binary | NO   |     | NULL    |       |
 | oi_size         | int(8) unsigned     | NO   |     | 0       |       |
 | oi_description  | tinyblob            | NO   |     | NULL    |       |
 | oi_user         | int(5) unsigned     | NO   |     | 0       |       |
 | oi_user_text    | varchar(255) binary | NO   |     | NULL    |       |
 | oi_timestamp    | char(14) binary     | NO   |     | NULL    |       |
 +-----------------+---------------------+------+-----+---------+-------+
DatabasesManual:Database layout Engines: MySQL/MariaDBManual:MySQLOracleManual:OraclePostgreSQLManual:PostgreSQLSQLiteManual:SQLiteSQL ServerManual:Microsoft SQL Server

Technical documentation: SchemaManual:Database layout (tablesCategory:MediaWiki database tables) – API property associationsAPI:Database field and API property associationsField prefixesDatabase field prefixesPrimary key storage in other fieldsManual:Primary key storage in other fieldsWikimedia extension tablesCategory:Wikimedia extension database tables
Configuration: SettingsManual:Configuration_settings#Database_settingsSharingManual:Shared database
Development: AccessManual:Database accessOptimizationDatabase optimizationPolicyDevelopment policy#Database_patchesUpdaterManual:DatabaseUpdater.phpExtension schema updatesManual:Hooks/LoadExtensionSchemaUpdatesPatch fileManual:SQL patch file

Core tables: archivebot_passwordscategorycategorylinkschange_tagconfigexternallinksfilearchivehitcounterimageimagelinksinterwikiiwlinksipblocksjobl10n_cachelanglinkslogginglog_searchmsg_resourcemsg_resource_linksmodule_depsobjectcacheoldimagepagepagelinkspage_propspage_restrictionsprotected_titlesquerycachequerycachetwoquerycache_inforecentchangesredirectrevisionsearchindexsitessite_identifiers - site_statstag_summarytemplatelinkstexttranscacheupdateloguploadstashuseruser_former_groupsuser_groupsuser_newtalkuser_propertiestag_summaryvalid_tagwatchlist