25
1
mirror of https://github.com/processone/ejabberd.git synced 2024-11-20 16:15:59 +01:00

Change PostgreSQL SERIAL to BIGSERIAL columns

This is consistent with other schemas, internally consistent with
foreign keys, and allows for > 2B records in these tables.
This commit is contained in:
Stu Tomlinson 2023-01-19 23:33:46 +00:00
parent d5bf051e79
commit 4f0e426a12
2 changed files with 10 additions and 10 deletions

View File

@ -244,7 +244,7 @@ CREATE TABLE spool (
username text NOT NULL, username text NOT NULL,
server_host text NOT NULL, server_host text NOT NULL,
xml text NOT NULL, xml text NOT NULL,
seq SERIAL, seq BIGSERIAL,
created_at TIMESTAMP NOT NULL DEFAULT now() created_at TIMESTAMP NOT NULL DEFAULT now()
); );
@ -258,7 +258,7 @@ CREATE TABLE archive (
bare_peer text NOT NULL, bare_peer text NOT NULL,
xml text NOT NULL, xml text NOT NULL,
txt text, txt text,
id SERIAL, id BIGSERIAL,
kind text, kind text,
nick text, nick text,
created_at TIMESTAMP NOT NULL DEFAULT now() created_at TIMESTAMP NOT NULL DEFAULT now()
@ -339,7 +339,7 @@ CREATE TABLE privacy_list (
username text NOT NULL, username text NOT NULL,
server_host text NOT NULL, server_host text NOT NULL,
name text NOT NULL, name text NOT NULL,
id SERIAL UNIQUE, id BIGSERIAL UNIQUE,
created_at TIMESTAMP NOT NULL DEFAULT now() created_at TIMESTAMP NOT NULL DEFAULT now()
); );
@ -394,7 +394,7 @@ CREATE TABLE pubsub_node (
node text NOT NULL, node text NOT NULL,
parent text NOT NULL DEFAULT '', parent text NOT NULL DEFAULT '',
plugin text NOT NULL, plugin text NOT NULL,
nodeid SERIAL UNIQUE nodeid BIGSERIAL UNIQUE
); );
CREATE INDEX i_pubsub_node_parent ON pubsub_node USING btree (parent); CREATE INDEX i_pubsub_node_parent ON pubsub_node USING btree (parent);
CREATE UNIQUE INDEX i_pubsub_node_tuple ON pubsub_node USING btree (host, node); CREATE UNIQUE INDEX i_pubsub_node_tuple ON pubsub_node USING btree (host, node);
@ -417,7 +417,7 @@ CREATE TABLE pubsub_state (
jid text NOT NULL, jid text NOT NULL,
affiliation character(1), affiliation character(1),
subscriptions text NOT NULL DEFAULT '', subscriptions text NOT NULL DEFAULT '',
stateid SERIAL UNIQUE stateid BIGSERIAL UNIQUE
); );
CREATE INDEX i_pubsub_state_jid ON pubsub_state USING btree (jid); CREATE INDEX i_pubsub_state_jid ON pubsub_state USING btree (jid);
CREATE UNIQUE INDEX i_pubsub_state_tuple ON pubsub_state USING btree (nodeid, jid); CREATE UNIQUE INDEX i_pubsub_state_tuple ON pubsub_state USING btree (nodeid, jid);

View File

@ -82,7 +82,7 @@ CREATE INDEX i_sr_user_grp ON sr_user USING btree (grp);
CREATE TABLE spool ( CREATE TABLE spool (
username text NOT NULL, username text NOT NULL,
xml text NOT NULL, xml text NOT NULL,
seq SERIAL, seq BIGSERIAL,
created_at TIMESTAMP NOT NULL DEFAULT now() created_at TIMESTAMP NOT NULL DEFAULT now()
); );
@ -95,7 +95,7 @@ CREATE TABLE archive (
bare_peer text NOT NULL, bare_peer text NOT NULL,
xml text NOT NULL, xml text NOT NULL,
txt text, txt text,
id SERIAL, id BIGSERIAL,
kind text, kind text,
nick text, nick text,
created_at TIMESTAMP NOT NULL DEFAULT now() created_at TIMESTAMP NOT NULL DEFAULT now()
@ -167,7 +167,7 @@ CREATE TABLE privacy_default_list (
CREATE TABLE privacy_list ( CREATE TABLE privacy_list (
username text NOT NULL, username text NOT NULL,
name text NOT NULL, name text NOT NULL,
id SERIAL UNIQUE, id BIGSERIAL UNIQUE,
created_at TIMESTAMP NOT NULL DEFAULT now() created_at TIMESTAMP NOT NULL DEFAULT now()
); );
@ -220,7 +220,7 @@ CREATE TABLE pubsub_node (
node text NOT NULL, node text NOT NULL,
parent text NOT NULL DEFAULT '', parent text NOT NULL DEFAULT '',
plugin text NOT NULL, plugin text NOT NULL,
nodeid SERIAL UNIQUE nodeid BIGSERIAL UNIQUE
); );
CREATE INDEX i_pubsub_node_parent ON pubsub_node USING btree (parent); CREATE INDEX i_pubsub_node_parent ON pubsub_node USING btree (parent);
CREATE UNIQUE INDEX i_pubsub_node_tuple ON pubsub_node USING btree (host, node); CREATE UNIQUE INDEX i_pubsub_node_tuple ON pubsub_node USING btree (host, node);
@ -243,7 +243,7 @@ CREATE TABLE pubsub_state (
jid text NOT NULL, jid text NOT NULL,
affiliation character(1), affiliation character(1),
subscriptions text NOT NULL DEFAULT '', subscriptions text NOT NULL DEFAULT '',
stateid SERIAL UNIQUE stateid BIGSERIAL UNIQUE
); );
CREATE INDEX i_pubsub_state_jid ON pubsub_state USING btree (jid); CREATE INDEX i_pubsub_state_jid ON pubsub_state USING btree (jid);
CREATE UNIQUE INDEX i_pubsub_state_tuple ON pubsub_state USING btree (nodeid, jid); CREATE UNIQUE INDEX i_pubsub_state_tuple ON pubsub_state USING btree (nodeid, jid);