diff --git a/sql/pg.sql b/sql/pg.sql index 458ea8f7a72..e072e33e840 100644 --- a/sql/pg.sql +++ b/sql/pg.sql @@ -58,7 +58,7 @@ CREATE TABLE rostergroups ( username text NOT NULL, jid text NOT NULL, grp text NOT NULL, - PRIMARY KEY (username, jid) + PRIMARY KEY (username, jid, grp) ); CREATE TABLE sr_group ( @@ -173,7 +173,8 @@ CREATE TABLE privacy_list ( CREATE UNIQUE INDEX i_privacy_list_username_name ON privacy_list USING btree (username, name); CREATE TABLE privacy_list_data ( - id bigint PRIMARY KEY REFERENCES privacy_list(id) ON DELETE CASCADE, + seq BIGSERIAL PRIMARY KEY, + id bigint REFERENCES privacy_list(id) ON DELETE CASCADE, t character(1) NOT NULL, value text NOT NULL, action character(1) NOT NULL,