Merge "Add ip_changes to postgres/tables.sql"
authorjenkins-bot <jenkins-bot@gerrit.wikimedia.org>
Wed, 29 Nov 2017 21:29:22 +0000 (21:29 +0000)
committerGerrit Code Review <gerrit@wikimedia.org>
Wed, 29 Nov 2017 21:29:22 +0000 (21:29 +0000)
maintenance/postgres/tables.sql

index d6d2f24..da9c864 100644 (file)
@@ -158,6 +158,17 @@ CREATE TABLE revision_comment_temp (
 );
 CREATE UNIQUE INDEX revcomment_rev ON revision_comment_temp (revcomment_rev);
 
+CREATE SEQUENCE ip_changes_ipc_rev_id_seq;
+
+CREATE TABLE ip_changes (
+  ipc_rev_id        INTEGER PRIMARY KEY NOT NULL DEFAULT nextval('ip_changes_ipc_rev_id_seq'),
+  ipc_rev_timestamp TIMESTAMPTZ NOT NULL,
+  ipc_hex           BYTEA NOT NULL DEFAULT ''
+);
+
+CREATE INDEX ipc_rev_timestamp ON ip_changes (ipc_rev_timestamp);
+CREATE INDEX ipc_hex_time ON ip_changes (ipc_hex,ipc_rev_timestamp);
+
 CREATE SEQUENCE text_old_id_seq;
 CREATE TABLE pagecontent ( -- replaces reserved word 'text'
   old_id     INTEGER  NOT NULL  PRIMARY KEY DEFAULT nextval('text_old_id_seq'),