Manual:filearchive table

From MediaWiki.org
Jump to: navigation, search
Manual:ContentsManual:Contents MediaWiki database layoutManual:Database layout filearchive table


The filearchive table stores information on all the media that has been deleted, similar to the archive table's job for deleted text revisions. These files are located in the storage for deleted files; in the local storage this most likely is the folder images/deleted/. This is the table that makes image undeletion possible. Prior to MediaWiki 1.11, this was disabled per default, and Manual:$wgSaveDeletedFiles had to be set to true to enable it. Since version 1.11, the behavior is controlled by $wgFileStore, and deleted files are per default stored in $wgUploadDirectory/deleted. See also: Oldimage table

Fields[edit]

fa_id[edit]

Unique row id.

fa_name[edit]

Original base filename; key to image.img_name, page.page_title, etc.

fa_archive_name[edit]

Filename of archived file, if an old revision, with prepended timestamp. E.g. 20090311210905!Constant_and_setup.png.

fa_storage_group[edit]

Which storage bin (directory tree or object store) the file data is stored in. Should be 'deleted' for files that have been deleted; any other bin is not yet in use.

fa_storage_key[edit]

SHA-1 of the file contents plus extension, used as a key for storage. eg 8f8a562add37052a1848ff7771a2c515db94baa9.jpg

fa_deleted_user[edit]

User who deleted the file

fa_deleted_timestamp[edit]

Time of deletion, if this file is deleted

fa_deleted_reason[edit]

Deletion comment, if this file is deleted

fa_size[edit]

File size in bytes. Duplicate of img_size.

fa_width[edit]

Image width, in pixels. Duplicate of img_width.

fa_height[edit]

Image height, in pixels. Duplicate of img_height.

fa_metadata[edit]

Serialized PHP array of the file's properties. Duplicate of img_metadata.

fa_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. Duplicate of img_bits.

fa_media_type[edit]

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

fa_major_mime[edit]

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

fa_minor_mime[edit]

E.g. jpeg, gif, png, etc. Duplicate of img_minor_mime.

fa_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. Duplicate of img_description.

fa_user[edit]

User ID of the user who uploaded the file. Duplicate of img_user.

fa_user_text[edit]

User name of the user who uploaded the file. Duplicate of img_user_text.

fa_timestamp[edit]

Timestamp of when upload took place. Duplicate of img_timestamp.

fa_deleted[edit]

MediaWiki version: 1.10

Visibility of deleted revisions, bitfield.

fa_sha1[edit]

MediaWiki version: 1.21

sha1 hash of file content

Schema summary[edit]

MediaWiki version: 1.25

DESCRIBE filearchive;

+----------------------+--------------------------------------------------------------------------------------------------------+------+-----+---------+----------------+
| Field                | Type                                                                                                   | Null | Key | Default | Extra          |
+----------------------+--------------------------------------------------------------------------------------------------------+------+-----+---------+----------------+
| fa_id                | int(11)                                                                                                | NO   | PRI | NULL    | AUTO_INCREMENT |
| fa_name              | varchar(255)                                                                                           | NO   | MUL |         |                |
| fa_archive_name      | varchar(255)                                                                                           | YES  |     |         |                |
| fa_storage_group     | varbinary(16)                                                                                          | YES  | MUL | NULL    |                |
| fa_storage_key       | varbinary(64)                                                                                          | YES  |     |         |                |
| fa_deleted_user      | int(11)                                                                                                | YES  | MUL | NULL    |                |
| fa_deleted_timestamp | binary(14)                                                                                             | YES  | MUL |         |                |
| fa_deleted_reason    | varbinary(767)                                                                                         | YES  |     | NULL    |                |
| fa_size              | int(10) unsigned                                                                                       | YES  |     | 0       |                |
| fa_width             | int(11)                                                                                                | YES  |     | 0       |                |
| fa_height            | int(11)                                                                                                | YES  |     | 0       |                |
| fa_metadata          | mediumblob                                                                                             | YES  |     | NULL    |                |
| fa_bits              | int(11)                                                                                                | YES  |     | 0       |                |
| fa_media_type        | enum('UNKNOWN','BITMAP','DRAWING','AUDIO','VIDEO','MULTIMEDIA','OFFICE','TEXT','EXECUTABLE','ARCHIVE') | YES  |     | NULL    |                |
| fa_major_mime        | enum('unknown','application','audio','image','text','video','message','model','multipart','chemical')  | YES  |     | unknown |                |
| fa_minor_mime        | varbinary(100)                                                                                         | YES  |     | unknown |                |
| fa_description       | varbinary(767)                                                                                         | YES  |     | NULL    |                |
| fa_user              | int(10) unsigned                                                                                       | YES  |     | 0       |                |
| fa_user_text         | varchar(255)                                                                                           | YES  |     | NULL    |                |
| fa_timestamp         | binary(14)                                                                                             | YES  |     | NULL    |                |
| fa_deleted           | tinyint(3) unsigned                                                                                    | NO   |     | 0       |                |
| fa_sha1              | varbinary(32|                                                                                          | NO   |     | NULL    |                |
+----------------------+--------------------------------------------------------------------------------------------------------+------+-----+---------+----------------+


MediaWiki version: 1.24

DESCRIBE filearchive;

+----------------------+--------------------------------------------------------------------------------------------------------+------+-----+---------+----------------+
| Field                | Type                                                                                                   | Null | Key | Default | Extra          |
+----------------------+--------------------------------------------------------------------------------------------------------+------+-----+---------+----------------+
| fa_id                | int(11)                                                                                                | NO   | PRI | NULL    | AUTO_INCREMENT |
| fa_name              | varchar(255)                                                                                           | NO   | MUL |         |                |
| fa_archive_name      | varchar(255)                                                                                           | YES  |     |         |                |
| fa_storage_group     | varbinary(16)                                                                                          | YES  | MUL | NULL    |                |
| fa_storage_key       | varbinary(64)                                                                                          | YES  |     |         |                |
| fa_deleted_user      | int(11)                                                                                                | YES  | MUL | NULL    |                |
| fa_deleted_timestamp | binary(14)                                                                                             | YES  | MUL |         |                |
| fa_deleted_reason    | text                                                                                                   | YES  |     | NULL    |                |
| fa_size              | int(10) unsigned                                                                                       | YES  |     | 0       |                |
| fa_width             | int(11)                                                                                                | YES  |     | 0       |                |
| fa_height            | int(11)                                                                                                | YES  |     | 0       |                |
| fa_metadata          | mediumblob                                                                                             | YES  |     | NULL    |                |
| fa_bits              | int(11)                                                                                                | YES  |     | 0       |                |
| fa_media_type        | enum('UNKNOWN','BITMAP','DRAWING','AUDIO','VIDEO','MULTIMEDIA','OFFICE','TEXT','EXECUTABLE','ARCHIVE') | YES  |     | NULL    |                |
| fa_major_mime        | enum('unknown','application','audio','image','text','video','message','model','multipart','chemical')  | YES  |     | unknown |                |
| fa_minor_mime        | varbinary(100)                                                                                         | YES  |     | unknown |                |
| fa_description       | tinyblob                                                                                               | YES  |     | NULL    |                |
| fa_user              | int(10) unsigned                                                                                       | YES  |     | 0       |                |
| fa_user_text         | varchar(255)                                                                                           | YES  |     | NULL    |                |
| fa_timestamp         | binary(14)                                                                                             | YES  |     | NULL    |                |
| fa_deleted           | tinyint(3) unsigned                                                                                    | NO   |     | 0       |                |
| fa_sha1              | varbinary(32|                                                                                          | NO   |     | NULL    |                |
+----------------------+--------------------------------------------------------------------------------------------------------+------+-----+---------+----------------+


MediaWiki versions: 1.21 – 1.23

DESCRIBE filearchive;

+----------------------+--------------------------------------------------------------------------------------------------------+------+-----+---------+----------------+
| Field                | Type                                                                                                   | Null | Key | Default | Extra          |
+----------------------+--------------------------------------------------------------------------------------------------------+------+-----+---------+----------------+
| fa_id                | int(11)                                                                                                | NO   | PRI | NULL    | AUTO_INCREMENT |
| fa_name              | varchar(255)                                                                                           | NO   | MUL |         |                |
| fa_archive_name      | varchar(255)                                                                                           | YES  |     |         |                |
| fa_storage_group     | varbinary(16)                                                                                          | YES  | MUL | NULL    |                |
| fa_storage_key       | varbinary(64)                                                                                          | YES  |     |         |                |
| fa_deleted_user      | int(11)                                                                                                | YES  | MUL | NULL    |                |
| fa_deleted_timestamp | binary(14)                                                                                             | YES  | MUL |         |                |
| fa_deleted_reason    | text                                                                                                   | YES  |     | NULL    |                |
| fa_size              | int(10) unsigned                                                                                       | YES  |     | 0       |                |
| fa_width             | int(11)                                                                                                | YES  |     | 0       |                |
| fa_height            | int(11)                                                                                                | YES  |     | 0       |                |
| fa_metadata          | mediumblob                                                                                             | YES  |     | NULL    |                |
| fa_bits              | int(11)                                                                                                | YES  |     | 0       |                |
| fa_media_type        | enum('UNKNOWN','BITMAP','DRAWING','AUDIO','VIDEO','MULTIMEDIA','OFFICE','TEXT','EXECUTABLE','ARCHIVE') | YES  |     | NULL    |                |
| fa_major_mime        | enum('unknown','application','audio','image','text','video','message','model','multipart')             | YES  |     | unknown |                |
| fa_minor_mime        | varbinary(100)                                                                                         | YES  |     | unknown |                |
| fa_description       | tinyblob                                                                                               | YES  |     | NULL    |                |
| fa_user              | int(10) unsigned                                                                                       | YES  |     | 0       |                |
| fa_user_text         | varchar(255)                                                                                           | YES  |     | NULL    |                |
| fa_timestamp         | binary(14)                                                                                             | YES  |     | NULL    |                |
| fa_deleted           | tinyint(3) unsigned                                                                                    | NO   |     | 0       |                |
| fa_sha1              | varbinary(32|                                                                                          | NO   |     | NULL    |                |
+----------------------+--------------------------------------------------------------------------------------------------------+------+-----+---------+----------------+


MediaWiki versions: 1.16 – 1.20

DESCRIBE filearchive;

+----------------------+--------------------------------------------------------------------------------------------------------+------+-----+---------+----------------+
| Field                | Type                                                                                                   | Null | Key | Default | Extra          |
+----------------------+--------------------------------------------------------------------------------------------------------+------+-----+---------+----------------+
| fa_id                | int(11)                                                                                                | NO   | PRI | NULL    | AUTO_INCREMENT |
| fa_name              | varchar(255)                                                                                           | NO   | MUL |         |                |
| fa_archive_name      | varchar(255)                                                                                           | YES  |     |         |                |
| fa_storage_group     | varbinary(16)                                                                                          | YES  | MUL | NULL    |                |
| fa_storage_key       | varbinary(64)                                                                                          | YES  |     |         |                |
| fa_deleted_user      | int(11)                                                                                                | YES  | MUL | NULL    |                |
| fa_deleted_timestamp | binary(14)                                                                                             | YES  | MUL |         |                |
| fa_deleted_reason    | text                                                                                                   | YES  |     | NULL    |                |
| fa_size              | int(10) unsigned                                                                                       | YES  |     | 0       |                |
| fa_width             | int(11)                                                                                                | YES  |     | 0       |                |
| fa_height            | int(11)                                                                                                | YES  |     | 0       |                |
| fa_metadata          | mediumblob                                                                                             | YES  |     | NULL    |                |
| fa_bits              | int(11)                                                                                                | YES  |     | 0       |                |
| fa_media_type        | enum('UNKNOWN','BITMAP','DRAWING','AUDIO','VIDEO','MULTIMEDIA','OFFICE','TEXT','EXECUTABLE','ARCHIVE') | YES  |     | NULL    |                |
| fa_major_mime        | enum('unknown','application','audio','image','text','video','message','model','multipart')             | YES  |     | unknown |                |
| fa_minor_mime        | varbinary(100)                                                                                         | YES  |     | unknown |                |
| fa_description       | tinyblob                                                                                               | YES  |     | NULL    |                |
| fa_user              | int(10) unsigned                                                                                       | YES  |     | 0       |                |
| fa_user_text         | varchar(255)                                                                                           | YES  |     | NULL    |                |
| fa_timestamp         | binary(14)                                                                                             | YES  |     | NULL    |                |
| fa_deleted           | tinyint(3) unsigned                                                                                    | NO   |     | 0       |                |
+----------------------+--------------------------------------------------------------------------------------------------------+------+-----+---------+----------------+


MediaWiki versions: 1.10 – 1.15

DESCRIBE filearchive;

+----------------------+--------------------------------------------------------------------------------------------------------+------+-----+---------+----------------+
| Field                | Type                                                                                                   | Null | Key | Default | Extra          |
+----------------------+--------------------------------------------------------------------------------------------------------+------+-----+---------+----------------+
| fa_id                | int(11)                                                                                                | NO   | PRI | NULL    | AUTO_INCREMENT |
| fa_name              | varchar(255)                                                                                           | NO   | MUL |         |                |
| fa_archive_name      | varchar(255)                                                                                           | YES  |     |         |                |
| fa_storage_group     | varbinary(16)                                                                                          | YES  | MUL | NULL    |                |
| fa_storage_key       | varbinary(64)                                                                                          | YES  |     |         |                |
| fa_deleted_user      | int(11)                                                                                                | YES  | MUL | NULL    |                |
| fa_deleted_timestamp | binary(14)                                                                                             | YES  | MUL |         |                |
| fa_deleted_reason    | text                                                                                                   | YES  |     | NULL    |                |
| fa_size              | int(10) unsigned                                                                                       | YES  |     | 0       |                |
| fa_width             | int(11)                                                                                                | YES  |     | 0       |                |
| fa_height            | int(11)                                                                                                | YES  |     | 0       |                |
| fa_metadata          | mediumblob                                                                                             | YES  |     | NULL    |                |
| fa_bits              | int(11)                                                                                                | YES  |     | 0       |                |
| fa_media_type        | enum('UNKNOWN','BITMAP','DRAWING','AUDIO','VIDEO','MULTIMEDIA','OFFICE','TEXT','EXECUTABLE','ARCHIVE') | YES  |     | NULL    |                |
| fa_major_mime        | enum('unknown','application','audio','image','text','video','message','model','multipart')             | YES  |     | unknown |                |
| fa_minor_mime        | varbinary(32)                                                                                          | YES  |     | unknown |                |
| fa_description       | tinyblob                                                                                               | YES  |     | NULL    |                |
| fa_user              | int(10) unsigned                                                                                       | YES  |     | 0       |                |
| fa_user_text         | varchar(255)                                                                                           | YES  |     | NULL    |                |
| fa_timestamp         | binary(14)                                                                                             | YES  |     | NULL    |                |
| fa_deleted           | tinyint(3) unsigned                                                                                    | NO   |     | 0       |                |
+----------------------+--------------------------------------------------------------------------------------------------------+------+-----+---------+----------------+


MediaWiki version: 1.9

DESCRIBE filearchive;

+----------------------+--------------------------------------------------------------------------------------------------------+------+-----+---------+----------------+
| Field                | Type                                                                                                   | Null | Key | Default | Extra          |
+----------------------+--------------------------------------------------------------------------------------------------------+------+-----+---------+----------------+
| fa_id                | int(11)                                                                                                | NO   | PRI | NULL    | auto_increment |
| fa_name              | varchar(255)                                                                                           | NO   | MUL |         |                |
| fa_archive_name      | varchar(255)                                                                                           | YES  |     |         |                |
| fa_storage_group     | varchar(16)                                                                                            | YES  | MUL | NULL    |                |
| fa_storage_key       | varchar(64)                                                                                            | YES  |     |         |                |
| fa_deleted_user      | int(11)                                                                                                | YES  | MUL | NULL    |                |
| fa_deleted_timestamp | char(14)                                                                                               | YES  | MUL |         |                |
| fa_deleted_reason    | text                                                                                                   | YES  |     | NULL    |                |
| fa_size              | int(8) unsigned                                                                                        | YES  |     | 0       |                |
| fa_width             | int(5)                                                                                                 | YES  |     | 0       |                |
| fa_height            | int(5)                                                                                                 | YES  |     | 0       |                |
| fa_metadata          | mediumblob                                                                                             | YES  |     | NULL    |                |
| fa_bits              | int(3)                                                                                                 | YES  |     | 0       |                |
| fa_media_type        | enum('UNKNOWN','BITMAP','DRAWING','AUDIO','VIDEO','MULTIMEDIA','OFFICE','TEXT','EXECUTABLE','ARCHIVE') | YES  |     | NULL    |                |
| fa_major_mime        | enum('unknown','application','audio','image','text','video','message','model','multipart')             | YES  |     | unknown |                |
| fa_minor_mime        | varchar(32)                                                                                            | YES  |     | unknown |                |
| fa_description       | tinyblob                                                                                               | YES  |     | NULL    |                |
| fa_user              | int(5) unsigned                                                                                        | YES  |     | 0       |                |
| fa_user_text         | varchar(255)                                                                                           | YES  |     | NULL    |                |
| fa_timestamp         | char(14)                                                                                               | YES  |     | NULL    |                |
+----------------------+--------------------------------------------------------------------------------------------------------+------+-----+---------+----------------+


MediaWiki versions: 1.7 – 1.8

DESCRIBE filearchive;

+----------------------+--------------------------------------------------------------------------------------------------------+------+-----+---------+----------------+
| Field                | Type                                                                                                   | Null | Key | Default | Extra          |
+----------------------+--------------------------------------------------------------------------------------------------------+------+-----+---------+----------------+
| fa_id                | int(11)                                                                                                | NO   | PRI | NULL    | AUTO_INCREMENT |
| fa_name              | varchar(255)                                                                                           | NO   | MUL |         |                |
| fa_archive_name      | varchar(255)                                                                                           | YES  |     |         |                |
| fa_storage_group     | varchar(16)                                                                                            | YES  | MUL | NULL    |                |
| fa_storage_key       | varchar(64)                                                                                            | YES  |     |         |                |
| fa_deleted_user      | int(11)                                                                                                | YES  | MUL | NULL    |                |
| fa_deleted_timestamp | char(14)                                                                                               | YES  | MUL |         |                |
| fa_deleted_reason    | text                                                                                                   | YES  |     | NULL    |                |
| fa_size              | int(8) unsigned                                                                                        | YES  |     | 0       |                |
| fa_width             | int(5)                                                                                                 | YES  |     | 0       |                |
| fa_height            | int(5)                                                                                                 | YES  |     | 0       |                |
| fa_metadata          | mediumblob                                                                                             | YES  |     | NULL    |                |
| fa_bits              | int(3)                                                                                                 | YES  |     | 0       |                |
| fa_media_type        | enum('UNKNOWN','BITMAP','DRAWING','AUDIO','VIDEO','MULTIMEDIA','OFFICE','TEXT','EXECUTABLE','ARCHIVE') | YES  |     | NULL    |                |
| fa_major_mime        | enum('unknown','application','audio','image','text','video','message','model','multipart')             | YES  |     | unknown |                |
| fa_minor_mime        | varchar(32)                                                                                            | YES  |     | unknown |                |
| fa_description       | tinyblob                                                                                               | YES  |     | NULL    |                |
| fa_user              | int(5) unsigned                                                                                        | YES  |     | 0       |                |
| fa_user_text         | varchar(255)                                                                                           | YES  |     |         |                |
| fa_timestamp         | char(14)                                                                                               | YES  |     |         |                |
+----------------------+--------------------------------------------------------------------------------------------------------+------+-----+---------+----------------+
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
Language:Project:Language policy English  • 日本語 • polski