Merge "Bug 35681 - Upgrade jQuery UI to 1.8.18"
[mediawiki.git] / maintenance / archives / patch-uploadstash.sql
blob2512076f496adc4a03e645214b6a6b8222cd6b8b
1 --
2 -- Store information about newly uploaded files before they're 
3 -- moved into the actual filestore
4 --
5 CREATE TABLE /*_*/uploadstash (
6         us_id int unsigned NOT NULL PRIMARY KEY auto_increment,
7         
8         -- the user who uploaded the file.
9         us_user int unsigned NOT NULL,
11         -- file key. this is how applications actually search for the file.
12         -- this might go away, or become the primary key.
13         us_key varchar(255) NOT NULL,
15         -- the original path
16         us_orig_path varchar(255) NOT NULL,
17         
18         -- the temporary path at which the file is actually stored
19         us_path varchar(255) NOT NULL,
20         
21         -- which type of upload the file came from (sometimes)
22         us_source_type varchar(50),
23         
24         -- the date/time on which the file was added
25         us_timestamp varbinary(14) not null,
26         
27         us_status varchar(50) not null,
29         -- file properties from File::getPropsFromPath.  these may prove unnecessary.
30         --
31         us_size int unsigned NOT NULL,
32         -- this hash comes from File::sha1Base36(), and is 31 characters
33         us_sha1 varchar(31) NOT NULL,
34         us_mime varchar(255),
35         -- Media type as defined by the MEDIATYPE_xxx constants, should duplicate definition in the image table
36         us_media_type ENUM("UNKNOWN", "BITMAP", "DRAWING", "AUDIO", "VIDEO", "MULTIMEDIA", "OFFICE", "TEXT", "EXECUTABLE", "ARCHIVE") default NULL,
37         -- image-specific properties
38         us_image_width int unsigned,
39         us_image_height int unsigned,
40         us_image_bits smallint unsigned
41         
42 ) /*$wgDBTableOptions*/;
44 -- sometimes there's a delete for all of a user's stuff.
45 CREATE INDEX /*i*/us_user ON /*_*/uploadstash (us_user);
46 -- pick out files by key, enforce key uniqueness
47 CREATE UNIQUE INDEX /*i*/us_key ON /*_*/uploadstash (us_key);
48 -- the abandoned upload cleanup script needs this
49 CREATE INDEX /*i*/us_timestamp ON /*_*/uploadstash (us_timestamp);