Changed playlist storage to use a link table instead of embedded list.
This commit is contained in:
parent
84711a95fe
commit
e2ba4ab08b
@ -15,10 +15,18 @@ CREATE TABLE tags (
|
||||
CREATE TABLE playlists (
|
||||
id SERIAL PRIMARY KEY,
|
||||
name VARCHAR NOT NULL,
|
||||
media_file_ids INTEGER[] NOT NULL,
|
||||
mod_count INTEGER NOT NULL DEFAULT 0
|
||||
);
|
||||
|
||||
CREATE TABLE playlists_media_files (
|
||||
playlist_id INTEGER NOT NULL,
|
||||
media_file_id INTEGER NOT NULL,
|
||||
position INTEGER NOT NULL DEFAULT 0,
|
||||
FOREIGN KEY (playlist_id) REFERENCES playlists(id),
|
||||
FOREIGN KEY (media_file_id) REFERENCES media_files(id),
|
||||
PRIMARY KEY (playlist_id, media_file_id)
|
||||
);
|
||||
|
||||
CREATE TABLE bookmarks (
|
||||
id SERIAL PRIMARY KEY,
|
||||
name VARCHAR,
|
||||
|
Loading…
Reference in New Issue
Block a user