| 1 |
-- This file is automatically generated using maintenance/generateSchemaChangeSql.php. |
| 2 |
-- Source: maintenance/abstractSchemaChanges/patch-revision-cleanup.json |
| 3 |
-- Do not modify this file directly. |
| 4 |
-- See https://www.mediawiki.org/wiki/Manual:Schema_changes |
| 5 |
CREATE TEMPORARY TABLE /*_*/__temp__revision AS |
| 6 |
SELECT |
| 7 |
rev_id, |
| 8 |
rev_page, |
| 9 |
rev_comment_id, |
| 10 |
rev_actor, |
| 11 |
rev_timestamp, |
| 12 |
rev_minor_edit, |
| 13 |
rev_deleted, |
| 14 |
rev_len, |
| 15 |
rev_parent_id, |
| 16 |
rev_sha1 |
| 17 |
FROM /*_*/revision; |
| 18 |
DROP TABLE /*_*/revision; |
| 19 |
|
| 20 |
|
| 21 |
CREATE TABLE /*_*/revision ( |
| 22 |
rev_id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, |
| 23 |
rev_page INTEGER UNSIGNED NOT NULL, |
| 24 |
rev_comment_id BIGINT UNSIGNED NOT NULL, |
| 25 |
rev_actor BIGINT UNSIGNED NOT NULL, |
| 26 |
rev_timestamp BLOB NOT NULL, rev_minor_edit SMALLINT UNSIGNED DEFAULT 0 NOT NULL, |
| 27 |
rev_deleted SMALLINT UNSIGNED DEFAULT 0 NOT NULL, |
| 28 |
rev_len INTEGER UNSIGNED DEFAULT NULL, |
| 29 |
rev_parent_id BIGINT UNSIGNED DEFAULT NULL, |
| 30 |
rev_sha1 BLOB DEFAULT '' NOT NULL |
| 31 |
); |
| 32 |
INSERT INTO /*_*/revision ( |
| 33 |
rev_id, rev_page, rev_comment_id, |
| 34 |
rev_actor, rev_timestamp, rev_minor_edit, |
| 35 |
rev_deleted, rev_len, rev_parent_id, |
| 36 |
rev_sha1 |
| 37 |
) |
| 38 |
SELECT |
| 39 |
rev_id, |
| 40 |
rev_page, |
| 41 |
rev_comment_id, |
| 42 |
rev_actor, |
| 43 |
rev_timestamp, |
| 44 |
rev_minor_edit, |
| 45 |
rev_deleted, |
| 46 |
rev_len, |
| 47 |
rev_parent_id, |
| 48 |
rev_sha1 |
| 49 |
FROM |
| 50 |
/*_*/__temp__revision; |
| 51 |
DROP TABLE /*_*/__temp__revision; |
| 52 |
|
| 53 |
CREATE INDEX rev_timestamp ON /*_*/revision (rev_timestamp); |
| 54 |
|
| 55 |
CREATE INDEX rev_page_timestamp ON /*_*/revision (rev_page, rev_timestamp); |
| 56 |
|
| 57 |
CREATE INDEX rev_actor_timestamp ON /*_*/revision (rev_actor, rev_timestamp, rev_id); |
| 58 |
|
| 59 |
CREATE INDEX rev_page_actor_timestamp ON /*_*/revision ( |
| 60 |
rev_page, rev_actor, rev_timestamp |
| 61 |
); |