Manual:uploadstash table

From MediaWiki.org
Jump to: navigation, search

Other languages:
English • ‎日本語
Manual:ContentsManual:Contents MediaWiki database layoutManual:Database layout uploadstash table


MediaWiki version: 1.18

The uploadstash table stores information about newly uploaded files before they're moved into the actual filestore, see also Manual:UploadStashManual:UploadStash. It contains information on incomplete uploads; these can e.g. happen when the user left the upload page before the upload completed. The cleanupUploadStash.phpManual:cleanupUploadStash.php maintenance script can be used to remove orphaned entries from this table.

Fields[edit]

us_id[edit]

Primary key.

us_user[edit]

The user who uploaded the file.

us_key[edit]

File key. This is how applications actually search for the file. This might go away, or become the primary key.

us_orig_path[edit]

The original path.

us_path[edit]

The temporary path at which the file is actually stored.

us_source_type[edit]

Which type of upload the file came from (sometimes). E.g. "url"

us_timestamp[edit]

The date/time on which the file was added

us_status[edit]

E.g. "finished"

us_chunk_inx[edit]

MediaWiki version: 1.19

Chunk counter starts at 0, current offset is stored in us_size

us_props[edit]

MediaWiki version: 1.21

Serialized file properties from File::getPropsFromPath

us_size[edit]

File properties from File::getPropsFromPath. These may prove unnecessary.

us_sha1[edit]

This hash comes from File::sha1Base36(), and is 31 characters

us_mime[edit]

Combination of img_major_mimeManual:Image_table#img_major_mime and img_minor_mimeManual:Image_table#img_minor_mime. E.g., image/png

us_media_type[edit]

Media type as defined by the MEDIATYPE_xxx constants, should duplicate definition in the image table.

us_image_width[edit]

Image-specific property.

us_image_height[edit]

Image-specific property.

us_image_bits[edit]

Image-specific properties.

Schema summary[edit]

MediaWiki version: 1.21

DESCRIBE uploadstash;

+-----------------+--------------------------------------------------------------------------------------------------------+------+-----+---------+----------------+
| Field           | Type                                                                                                   | Null | Key | Default | Extra          |
+-----------------+--------------------------------------------------------------------------------------------------------+------+-----+---------+----------------+
| us_id           | int(10) unsigned                                                                                       | NO   | PRI | NULL    | AUTO_INCREMENT |
| us_user         | int(10) unsigned                                                                                       | NO   | MUL | NULL    |                |
| us_key          | varchar(255)                                                                                           | NO   | UNI | NULL    |                |
| us_orig_path    | varchar(255)                                                                                           | NO   |     | NULL    |                |
| us_path         | varchar(255)                                                                                           | NO   |     | NULL    |                |
| us_source_type  | varchar(50)                                                                                            | YES  |     | NULL    |                |
| us_timestamp    | varbinary(14)                                                                                          | NO   | MUL | NULL    |                |
| us_status       | varchar(50)                                                                                            | NO   |     | NULL    |                |
| us_chunk_inx    | int(10) unsigned                                                                                       | YES  |     | NULL    |                |
| us_props        | blob                                                                                                   | YES  |     | NULL    |                |
| us_size         | int(10) unsigned                                                                                       | NO   |     | NULL    |                |
| us_sha1         | varchar(31)                                                                                            | NO   |     | NULL    |                |
| us_mime         | varchar(255)                                                                                           | YES  |     | NULL    |                |
| us_media_type   | enum('UNKNOWN','BITMAP','DRAWING','AUDIO','VIDEO','MULTIMEDIA','OFFICE','TEXT','EXECUTABLE','ARCHIVE') | YES  |     | NULL    |                |
| us_image_width  | int(10) unsigned                                                                                       | YES  |     | NULL    |                |
| us_image_height | int(10) unsigned                                                                                       | YES  |     | NULL    |                |
| us_image_bits   | smallint(5) unsigned                                                                                   | YES  |     | NULL    |                |
+-----------------+--------------------------------------------------------------------------------------------------------+------+-----+---------+----------------+


MediaWiki versions: 1.19 – 1.20

DESCRIBE uploadstash;

+-----------------+--------------------------------------------------------------------------------------------------------+------+-----+---------+----------------+
| Field           | Type                                                                                                   | Null | Key | Default | Extra          |
+-----------------+--------------------------------------------------------------------------------------------------------+------+-----+---------+----------------+
| us_id           | int(10) unsigned                                                                                       | NO   | PRI | NULL    | AUTO_INCREMENT |
| us_user         | int(10) unsigned                                                                                       | NO   | MUL | NULL    |                |
| us_key          | varchar(255)                                                                                           | NO   | UNI | NULL    |                |
| us_orig_path    | varchar(255)                                                                                           | NO   |     | NULL    |                |
| us_path         | varchar(255)                                                                                           | NO   |     | NULL    |                |
| us_source_type  | varchar(50)                                                                                            | YES  |     | NULL    |                |
| us_timestamp    | varbinary(14)                                                                                          | NO   | MUL | NULL    |                |
| us_status       | varchar(50)                                                                                            | NO   |     | NULL    |                |
| us_chunk_inx    | int(10) unsigned                                                                                       | YES  |     | NULL    |                |
| us_size         | int(10) unsigned                                                                                       | NO   |     | NULL    |                |
| us_sha1         | varchar(31)                                                                                            | NO   |     | NULL    |                |
| us_mime         | varchar(255)                                                                                           | YES  |     | NULL    |                |
| us_media_type   | enum('UNKNOWN','BITMAP','DRAWING','AUDIO','VIDEO','MULTIMEDIA','OFFICE','TEXT','EXECUTABLE','ARCHIVE') | YES  |     | NULL    |                |
| us_image_width  | int(10) unsigned                                                                                       | YES  |     | NULL    |                |
| us_image_height | int(10) unsigned                                                                                       | YES  |     | NULL    |                |
| us_image_bits   | smallint(5) unsigned                                                                                   | YES  |     | NULL    |                |
+-----------------+--------------------------------------------------------------------------------------------------------+------+-----+---------+----------------+


MediaWiki version: 1.18

DESCRIBE uploadstash;

+-----------------+--------------------------------------------------------------------------------------------------------+------+-----+---------+----------------+
| Field           | Type                                                                                                   | Null | Key | Default | Extra          |
+-----------------+--------------------------------------------------------------------------------------------------------+------+-----+---------+----------------+
| us_id           | int(10) unsigned                                                                                       | NO   | PRI | NULL    | AUTO_INCREMENT |
| us_user         | int(10) unsigned                                                                                       | NO   | MUL | NULL    |                |
| us_key          | varchar(255)                                                                                           | NO   | UNI | NULL    |                |
| us_orig_path    | varchar(255)                                                                                           | NO   |     | NULL    |                |
| us_path         | varchar(255)                                                                                           | NO   |     | NULL    |                |
| us_source_type  | varchar(50)                                                                                            | YES  |     | NULL    |                |
| us_timestamp    | varbinary(14)                                                                                          | NO   | MUL | NULL    |                |
| us_status       | varchar(50)                                                                                            | NO   |     | NULL    |                |
| us_size         | int(10) unsigned                                                                                       | NO   |     | NULL    |                |
| us_sha1         | varchar(31)                                                                                            | NO   |     | NULL    |                |
| us_mime         | varchar(255)                                                                                           | YES  |     | NULL    |                |
| us_media_type   | enum('UNKNOWN','BITMAP','DRAWING','AUDIO','VIDEO','MULTIMEDIA','OFFICE','TEXT','EXECUTABLE','ARCHIVE') | YES  |     | NULL    |                |
| us_image_width  | int(10) unsigned                                                                                       | YES  |     | NULL    |                |
| us_image_height | int(10) unsigned                                                                                       | YES  |     | NULL    |                |
| us_image_bits   | smallint(5) unsigned                                                                                   | YES  |     | 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