Add playlist_videos table.

This commit is contained in:
Kavin 2023-08-14 09:01:00 +01:00
parent 96819a51c6
commit be7f54617d
No known key found for this signature in database
GPG Key ID: 6E4598CA5C92C41F

View File

@ -46,3 +46,18 @@ CREATE TABLE IF NOT EXISTS playlists (
);
--rollback DROP TABLE IF EXISTS playlists;
CREATE TABLE IF NOT EXISTS playlist_videos (
id VARCHAR(11) NOT NULL,
duration INT8 NULL,
thumbnail VARCHAR(400) NULL,
title VARCHAR(120) NULL,
uploader_id VARCHAR(24) NOT NULL,
CONSTRAINT playlist_videos_pkey PRIMARY KEY (id),
CONSTRAINT fk_playlist_video_uploader_id FOREIGN KEY (uploader_id) REFERENCES channels(uploader_id)
);
CREATE INDEX IF NOT EXISTS playlist_videos_id_idx ON playlist_videos (id ASC);
CREATE INDEX IF NOT EXISTS playlist_videos_uploader_id_idx ON playlist_videos (uploader_id ASC);
--rollback DROP TABLE IF EXISTS playlist_videos;