Merge "Align "What's this" vertically"
[lhc/web/wiklou.git] / maintenance / sqlite / archives / patch-text-fix-pk.sql
1 CREATE TABLE /*_*/text_tmp (
2 -- Unique text storage key number.
3 -- Note that the 'oldid' parameter used in URLs does *not*
4 -- refer to this number anymore, but to rev_id.
5 --
6 -- revision.rev_text_id is a key to this column
7 old_id int unsigned NOT NULL PRIMARY KEY AUTO_INCREMENT,
8
9 -- Depending on the contents of the old_flags field, the text
10 -- may be convenient plain text, or it may be funkily encoded.
11 old_text mediumblob NOT NULL,
12
13 -- Comma-separated list of flags:
14 -- gzip: text is compressed with PHP's gzdeflate() function.
15 -- utf-8: text was stored as UTF-8.
16 -- If $wgLegacyEncoding option is on, rows *without* this flag
17 -- will be converted to UTF-8 transparently at load time. Note
18 -- that due to a bug in a maintenance script, this flag may
19 -- have been stored as 'utf8' in some cases (T18841).
20 -- object: text field contained a serialized PHP object.
21 -- The object either contains multiple versions compressed
22 -- together to achieve a better compression ratio, or it refers
23 -- to another row where the text can be found.
24 -- external: text was stored in an external location specified by old_text.
25 -- Any additional flags apply to the data stored at that URL, not
26 -- the URL itself. The 'object' flag is *not* set for URLs of the
27 -- form 'DB://cluster/id/itemid', because the external storage
28 -- system itself decompresses these.
29 old_flags tinyblob NOT NULL
30 ) /*$wgDBTableOptions*/ MAX_ROWS=10000000 AVG_ROW_LENGTH=10240;
31
32 INSERT INTO /*_*/text_tmp
33 SELECT * FROM /*_*/text;
34
35 DROP TABLE /*_*/text;
36
37 ALTER TABLE /*_*/text_tmp RENAME TO /*_*/text;