| 1 |
-- This file is automatically generated using maintenance/generateSchemaSql.php. |
| 2 |
-- Source: sql/discussiontools_persistent.json |
| 3 |
-- Do not modify this file directly. |
| 4 |
-- See https://www.mediawiki.org/wiki/Manual:Schema_changes |
| 5 |
CREATE TABLE discussiontools_items ( |
| 6 |
it_id SERIAL NOT NULL, |
| 7 |
it_itemname TEXT NOT NULL, |
| 8 |
it_timestamp TIMESTAMPTZ DEFAULT NULL, |
| 9 |
it_actor BIGINT DEFAULT NULL, |
| 10 |
PRIMARY KEY(it_id) |
| 11 |
); |
| 12 |
|
| 13 |
CREATE UNIQUE INDEX it_itemname ON discussiontools_items (it_itemname); |
| 14 |
|
| 15 |
|
| 16 |
CREATE TABLE discussiontools_item_ids ( |
| 17 |
itid_id SERIAL NOT NULL, |
| 18 |
itid_itemid TEXT NOT NULL, |
| 19 |
PRIMARY KEY(itid_id) |
| 20 |
); |
| 21 |
|
| 22 |
CREATE UNIQUE INDEX itid_itemid ON discussiontools_item_ids (itid_itemid); |
| 23 |
|
| 24 |
|
| 25 |
CREATE TABLE discussiontools_item_pages ( |
| 26 |
itp_id SERIAL NOT NULL, |
| 27 |
itp_items_id INT NOT NULL, |
| 28 |
itp_page_id BIGINT NOT NULL, |
| 29 |
itp_oldest_revision_id BIGINT NOT NULL, |
| 30 |
itp_newest_revision_id BIGINT NOT NULL, |
| 31 |
PRIMARY KEY(itp_id) |
| 32 |
); |
| 33 |
|
| 34 |
CREATE UNIQUE INDEX itp_items_id_page_id ON discussiontools_item_pages (itp_items_id, itp_page_id); |
| 35 |
|
| 36 |
CREATE UNIQUE INDEX itp_items_id_newest_revision_id ON discussiontools_item_pages ( |
| 37 |
itp_items_id, itp_newest_revision_id |
| 38 |
); |
| 39 |
|
| 40 |
|
| 41 |
CREATE TABLE discussiontools_item_revisions ( |
| 42 |
itr_id SERIAL NOT NULL, |
| 43 |
itr_itemid_id INT NOT NULL, |
| 44 |
itr_revision_id BIGINT NOT NULL, |
| 45 |
itr_items_id INT NOT NULL, |
| 46 |
itr_parent_id INT DEFAULT NULL, |
| 47 |
itr_transcludedfrom BIGINT DEFAULT NULL, |
| 48 |
itr_level SMALLINT NOT NULL, |
| 49 |
itr_headinglevel SMALLINT DEFAULT NULL, |
| 50 |
PRIMARY KEY(itr_id) |
| 51 |
); |
| 52 |
|
| 53 |
CREATE INDEX itr_revision_id ON discussiontools_item_revisions (itr_revision_id); |
| 54 |
|
| 55 |
CREATE UNIQUE INDEX itr_itemid_id_revision_id ON discussiontools_item_revisions (itr_itemid_id, itr_revision_id); |