mirror of
https://github.com/agersant/polaris
synced 2024-11-26 23:40:18 +00:00
16 lines
487 B
SQL
16 lines
487 B
SQL
CREATE TABLE playlists (
|
|
id INTEGER PRIMARY KEY NOT NULL,
|
|
owner INTEGER NOT NULL,
|
|
name TEXT NOT NULL,
|
|
FOREIGN KEY(owner) REFERENCES users(id) ON DELETE CASCADE,
|
|
UNIQUE(owner, name) ON CONFLICT REPLACE
|
|
);
|
|
|
|
CREATE TABLE playlist_songs (
|
|
id INTEGER PRIMARY KEY NOT NULL,
|
|
playlist INTEGER NOT NULL,
|
|
path TEXT NOT NULL,
|
|
ordering INTEGER NOT NULL,
|
|
FOREIGN KEY(playlist) REFERENCES playlists(id) ON DELETE CASCADE ON UPDATE CASCADE,
|
|
UNIQUE(playlist, ordering) ON CONFLICT REPLACE
|
|
);
|