wiki.techinc.nl/maintenance/postgres/archives/patch-ip_changes.sql
MusikAnimal 70a602dde4 Add SQL for postgres, and fail gracefully in populateIpChanges
If the ip_changes table doesn't exist, the populateIpChanges maintenance
script will fail gracefully, throwing a descriptive error.

The postgres SQL is untested.

Bug: T177258
Change-Id: Ic11c64813ee04e8520771bfa156f8e51404273e7
2017-11-29 00:52:49 +00:00

10 lines
403 B
SQL

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 DEFAULT '',
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);