Reverted r42528. Links with href="#" make firefox scroll to the top of the page,...
[lhc/web/wiklou.git] / maintenance / storage / blob_tracking.sql
1
2 -- Table for tracking blobs prior to recompression or similar maintenance operations
3
4 CREATE TABLE /*$wgDBprefix*/blob_tracking (
5 -- page.page_id
6 -- This may be zero for orphan or deleted text
7 bt_page integer not null,
8
9 -- revision.rev_id
10 -- This may be zero for orphan or deleted text
11 bt_rev_id integer not null,
12
13 -- text.old_id
14 bt_text_id integer not null,
15
16 -- The ES cluster
17 bt_cluster varbinary(255),
18
19 -- The ES blob ID
20 bt_blob_id integer not null,
21
22 -- The CGZ content hash, or null
23 bt_cgz_hash varbinary(255),
24
25 -- The URL this blob is to be moved to
26 bt_new_url varbinary(255),
27
28 -- True if the text table has been updated to point to bt_new_url
29 bt_moved bool not null default 0,
30
31 PRIMARY KEY (bt_rev_id, bt_text_id),
32
33 -- Sort by page for easy CGZ recompression
34 KEY (bt_moved, bt_page, bt_rev_id),
35
36 -- For fast orphan searches
37 KEY (bt_text_id),
38
39 -- Key for determining the revisions using a given blob
40 KEY (bt_cluster, bt_blob_id, bt_cgz_hash)
41 ) /*$wgDBTableOptions*/;
42
43 -- Tracking table for blob rows that aren't tracked by the text table
44 CREATE TABLE /*$wgDBprefix*/blob_orphans (
45 bo_cluster varbinary(255),
46 bo_blob_id integer not null,
47
48 PRIMARY KEY (bo_cluster, bo_blob_id)
49 ) /*$wgDBTableOptions*/;
50