From: Greg Sabino Mullane Date: Mon, 13 Sep 2010 14:26:38 +0000 (+0000) Subject: Add the "page" table back in when upgrading from really old MW versions using Postgres X-Git-Tag: 1.31.0-rc.0~34961 X-Git-Url: http://git.cyclocoop.org/%24action?a=commitdiff_plain;h=84a28b19b73a5b8ff85cdb549b90d152af7be005;p=lhc%2Fweb%2Fwiklou.git Add the "page" table back in when upgrading from really old MW versions using Postgres --- diff --git a/includes/installer/PostgresUpdater.php b/includes/installer/PostgresUpdater.php index ce2dc51441..7066caecba 100644 --- a/includes/installer/PostgresUpdater.php +++ b/includes/installer/PostgresUpdater.php @@ -40,6 +40,7 @@ class PostgresUpdater extends DatabaseUpdater { # new tables array( 'addTable', 'category', 'patch-category.sql' ), array( 'addTable', 'mwuser', 'patch-mwuser.sql' ), + array( 'addTable', 'page', 'patch-page.sql' ), array( 'addTable', 'pagecontent', 'patch-pagecontent.sql' ), array( 'addTable', 'querycachetwo', 'patch-querycachetwo.sql' ), array( 'addTable', 'page_props', 'patch-page_props.sql' ), diff --git a/maintenance/postgres/archives/patch-page.sql b/maintenance/postgres/archives/patch-page.sql new file mode 100644 index 0000000000..cceef89897 --- /dev/null +++ b/maintenance/postgres/archives/patch-page.sql @@ -0,0 +1,24 @@ +CREATE SEQUENCE page_page_id_seq; +CREATE TABLE page ( + page_id INTEGER NOT NULL PRIMARY KEY DEFAULT nextval('page_page_id_seq'), + page_namespace SMALLINT NOT NULL, + page_title TEXT NOT NULL, + page_restrictions TEXT, + page_counter BIGINT NOT NULL DEFAULT 0, + page_is_redirect SMALLINT NOT NULL DEFAULT 0, + page_is_new SMALLINT NOT NULL DEFAULT 0, + page_random NUMERIC(15,14) NOT NULL DEFAULT RANDOM(), + page_touched TIMESTAMPTZ, + page_latest INTEGER NOT NULL, + page_len INTEGER NOT NULL +); +CREATE UNIQUE INDEX page_unique_name ON page (page_namespace, page_title); +CREATE INDEX page_main_title ON page (page_title) WHERE page_namespace = 0; +CREATE INDEX page_talk_title ON page (page_title) WHERE page_namespace = 1; +CREATE INDEX page_user_title ON page (page_title) WHERE page_namespace = 2; +CREATE INDEX page_utalk_title ON page (page_title) WHERE page_namespace = 3; +CREATE INDEX page_project_title ON page (page_title) WHERE page_namespace = 4; +CREATE INDEX page_mediawiki_title ON page (page_title) WHERE page_namespace = 8; +CREATE INDEX page_random_idx ON page (page_random); +CREATE INDEX page_len_idx ON page (page_len); +