Add unauthenticated_subscriptions table.

This commit is contained in:
Kavin 2023-08-14 09:30:53 +01:00
parent c8f7e52820
commit 657e63332e
No known key found for this signature in database
GPG key ID: 6E4598CA5C92C41F
3 changed files with 19 additions and 0 deletions

View file

@ -41,3 +41,7 @@ CREATE INDEX IF NOT EXISTS playlists_owner_idx ON playlists (owner ASC) STORING
--rollback DROP INDEX IF EXISTS playlists_playlist_id_idx;
--rollback DROP INDEX IF EXISTS playlists_owner_idx;
CREATE INDEX IF NOT EXISTS unauthenticated_subscriptions_id_idx ON unauthenticated_subscriptions (id ASC) USING HASH STORING (subscribed_at);
--rollback DROP INDEX IF EXISTS unauthenticated_subscriptions_id_idx;

View file

@ -42,3 +42,7 @@ CREATE INDEX IF NOT EXISTS playlists_owner_idx ON playlists (owner ASC);
--rollback DROP INDEX IF EXISTS playlists_playlist_id_idx;
--rollback DROP INDEX IF EXISTS playlists_owner_idx;
CREATE INDEX IF NOT EXISTS unauthenticated_subscriptions_id_idx ON unauthenticated_subscriptions (id ASC);
--rollback DROP INDEX IF EXISTS unauthenticated_subscriptions_id_idx;

View file

@ -74,3 +74,14 @@ CREATE TABLE IF NOT EXISTS playlists_videos_ids (
CREATE INDEX IF NOT EXISTS playlists_videos_ids_playlist_id_idx ON playlists_videos_ids (playlist_id ASC);
--rollback DROP TABLE IF EXISTS playlists_videos_ids;
CREATE TABLE IF NOT EXISTS unauthenticated_subscriptions (
id VARCHAR(24) NOT NULL,
subscribed_at INT8 NOT NULL,
CONSTRAINT unauthenticated_subscriptions_pkey PRIMARY KEY (id),
CONSTRAINT fk_unauthenticated_subscriptions_id_channels FOREIGN KEY (id) REFERENCES channels(uploader_id)
);
CREATE INDEX IF NOT EXISTS unauthenticated_subscriptions_subscribed_at_idx ON unauthenticated_subscriptions (subscribed_at ASC);
--rollback DROP TABLE IF EXISTS unauthenticated_subscriptions;