Add pubsub table.

This commit is contained in:
Kavin 2023-08-14 08:43:07 +01:00
parent b0a97faf4f
commit b3c06354f7
No known key found for this signature in database
GPG key ID: 6E4598CA5C92C41F
3 changed files with 18 additions and 0 deletions

View file

@ -31,3 +31,7 @@ CREATE TABLE IF NOT EXISTS users_subscribed (
);
--rollback DROP TABLE IF EXISTS users_subscribed;
CREATE INDEX IF NOT EXISTS pubsub_subbed_at_idx ON pubsub (subbed_at ASC) USING HASH;
--rollback DROP INDEX IF EXISTS pubsub_subbed_at_idx;

View file

@ -32,3 +32,7 @@ CREATE INDEX IF NOT EXISTS users_subscribed_subscriber_idx ON users_subscribed (
CREATE INDEX IF NOT EXISTS users_subscribed_channel_idx ON users_subscribed (channel ASC);
--rollback DROP TABLE IF EXISTS users_subscribed;
CREATE INDEX IF NOT EXISTS pubsub_subbed_at_idx ON pubsub (subbed_at ASC);
--rollback DROP INDEX IF EXISTS pubsub_subbed_at_idx;

View file

@ -23,3 +23,13 @@ CREATE TABLE IF NOT EXISTS channels (
CREATE INDEX IF NOT EXISTS channels_uploader_idx ON channels (uploader ASC);
--rollback DROP TABLE IF EXISTS channels;
CREATE TABLE IF NOT EXISTS pubsub (
id VARCHAR(24) NOT NULL,
subbed_at INT8 NULL,
CONSTRAINT pubsub_pkey PRIMARY KEY (id)
);
CREATE INDEX IF NOT EXISTS pubsub_id_idx ON pubsub (id ASC);
--rollback DROP TABLE IF EXISTS pubsub;