Manual:Uploadstash table/zh

表存放了近期上传的文件相关信息, 而这些文件尚未被移动实际存储中, 也可以看看. 它包含了未完成的上传操作的信息; 这些情况可能发生在比如当用户完成上传前离开了上传页面. 维护脚本可以用来从此表中删除孤立的条目

us_id
主键

us_user
上传了文件的 user

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

us_orig_path
The original path.

us_path
The temporary path at which the file is actually stored.

us_source_type
Which type of upload the file came from (sometimes). 例如： "url"

us_timestamp
The date/time on which the file was added

us_status
例如： "finished"

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

us_props
Serialized file properties from File::getPropsFromPath

us_size
File properties from. These may prove unnecessary.

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

us_mime
Combination of and. 例如： image/png

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

us_image_width
Image-specific property.

us_image_height
Image-specific property.

us_image_bits
Image-specific properties.

架构摘要
 +-+-+--+-+-++ +-+-+--+-+-++ +-+-+--+-+-++
 * 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         | varbinary(255)                                                                                              | NO   | UNI | NULL    |                |
 * us_orig_path   | varbinary(255)                                                                                              | NO   |     | NULL    |                |
 * us_path        | varbinary(255)                                                                                              | NO   |     | NULL    |                |
 * us_source_type | varbinary(50)                                                                                               | YES  |     | NULL    |                |
 * us_timestamp   | binary(14)                                                                                                  | NO   | MUL | NULL    |                |
 * us_status      | varbinary(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        | varbinary(31)                                                                                               | NO   |     | NULL    |                |
 * us_mime        | varbinary(255)                                                                                              | YES  |     | NULL    |                |
 * us_media_type  | enum('UNKNOWN','BITMAP','DRAWING','AUDIO','VIDEO','MULTIMEDIA','OFFICE','TEXT','EXECUTABLE','ARCHIVE','3D') | 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    |                |

 +-+-+--+-+-++ +-+-+--+-+-++ +-+-+--+-+-++
 * 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         | varbinary(255)                                                                                              | NO   | UNI | NULL    |                |
 * us_orig_path   | varbinary(255)                                                                                              | NO   |     | NULL    |                |
 * us_path        | varbinary(255)                                                                                              | NO   |     | NULL    |                |
 * us_source_type | varbinary(50)                                                                                               | YES  |     | NULL    |                |
 * us_timestamp   | varbinary(14)                                                                                               | NO   | MUL | NULL    |                |
 * us_status      | varbinary(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        | varbinary(31)                                                                                               | NO   |     | NULL    |                |
 * us_mime        | varbinary(255)                                                                                              | YES  |     | NULL    |                |
 * us_media_type  | enum('UNKNOWN','BITMAP','DRAWING','AUDIO','VIDEO','MULTIMEDIA','OFFICE','TEXT','EXECUTABLE','ARCHIVE','3D') | 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    |                |

 +-++--+-+-++ +-++--+-+-++ +-++--+-+-++
 * 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         | varbinary(255)                                                                                         | NO   | UNI | NULL    |                |
 * us_orig_path   | varbinary(255)                                                                                         | NO   |     | NULL    |                |
 * us_path        | varbinary(255)                                                                                         | NO   |     | NULL    |                |
 * us_source_type | varbinary(50)                                                                                          | YES  |     | NULL    |                |
 * us_timestamp   | varbinary(14)                                                                                          | NO   | MUL | NULL    |                |
 * us_status      | varbinary(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        | varbinary(31)                                                                                          | NO   |     | NULL    |                |
 * us_mime        | varbinary(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    |                |

 +-++--+-+-++ +-++--+-+-++ +-++--+-+-++
 * 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         | varbinary(255)                                                                                         | NO   | UNI | NULL    |                |
 * us_orig_path   | varbinary(255)                                                                                         | NO   |     | NULL    |                |
 * us_path        | varbinary(255)                                                                                         | NO   |     | NULL    |                |
 * us_source_type | varbinary(50)                                                                                          | YES  |     | NULL    |                |
 * us_timestamp   | varbinary(14)                                                                                          | NO   | MUL | NULL    |                |
 * us_status      | varbinary(50)                                                                                          | NO   |     | NULL    |                |
 * us_chunk_inx   | int(10) unsigned                                                                                       | YES  |     | NULL    |                |
 * us_size        | int(10) unsigned                                                                                       | NO   |     | NULL    |                |
 * us_sha1        | varbinary(31)                                                                                          | NO   |     | NULL    |                |
 * us_mime        | varbinary(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    |                |

 +-++--+-+-++ +-++--+-+-++ +-++--+-+-++
 * 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         | varbinary(255)                                                                                         | NO   | UNI | NULL    |                |
 * us_orig_path   | varbinary(255)                                                                                         | NO   |     | NULL    |                |
 * us_path        | varbinary(255)                                                                                         | NO   |     | NULL    |                |
 * us_source_type | varbinary(50)                                                                                          | YES  |     | NULL    |                |
 * us_timestamp   | varbinary(14)                                                                                          | NO   | MUL | NULL    |                |
 * us_status      | varbinary(50)                                                                                          | NO   |     | NULL    |                |
 * us_size        | int(10) unsigned                                                                                       | NO   |     | NULL    |                |
 * us_sha1        | varbinary(31)                                                                                          | NO   |     | NULL    |                |
 * us_mime        | varbinary(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    |                |