mirror of
https://github.com/TeamPiped/Piped-Backend.git
synced 2024-12-12 21:30:29 +05:30
Add playlists table.
This commit is contained in:
parent
b3c06354f7
commit
dc7801b4d3
@ -35,3 +35,9 @@ CREATE TABLE IF NOT 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;
|
||||
|
||||
CREATE INDEX IF NOT EXISTS playlists_playlist_id_idx ON playlists (playlist_id ASC) STORING (name, short_description, thumbnail, owner);
|
||||
CREATE INDEX IF NOT EXISTS playlists_owner_idx ON playlists (owner ASC) STORING (name, short_description, thumbnail, playlist_id);
|
||||
|
||||
--rollback DROP INDEX IF EXISTS playlists_playlist_id_idx;
|
||||
--rollback DROP INDEX IF EXISTS playlists_owner_idx;
|
||||
|
@ -36,3 +36,9 @@ CREATE INDEX IF NOT EXISTS users_subscribed_channel_idx ON users_subscribed (cha
|
||||
CREATE INDEX IF NOT EXISTS pubsub_subbed_at_idx ON pubsub (subbed_at ASC);
|
||||
|
||||
--rollback DROP INDEX IF EXISTS pubsub_subbed_at_idx;
|
||||
|
||||
CREATE INDEX IF NOT EXISTS playlists_playlist_id_idx ON playlists (playlist_id ASC);
|
||||
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;
|
||||
|
@ -33,3 +33,16 @@ CREATE TABLE IF NOT EXISTS pubsub (
|
||||
CREATE INDEX IF NOT EXISTS pubsub_id_idx ON pubsub (id ASC);
|
||||
|
||||
--rollback DROP TABLE IF EXISTS pubsub;
|
||||
|
||||
CREATE TABLE IF NOT EXISTS playlists (
|
||||
id SERIAL NOT NULL,
|
||||
name VARCHAR(200) NULL,
|
||||
playlist_id UUID NOT NULL UNIQUE DEFAULT gen_random_uuid(),
|
||||
short_description VARCHAR(100) NULL,
|
||||
thumbnail VARCHAR(300) NULL,
|
||||
owner INT8 NOT NULL,
|
||||
CONSTRAINT playlists_pkey PRIMARY KEY (id),
|
||||
CONSTRAINT fk_playlists_owner FOREIGN KEY (owner) REFERENCES users(id)
|
||||
);
|
||||
|
||||
--rollback DROP TABLE IF EXISTS playlists;
|
||||
|
Loading…
Reference in New Issue
Block a user