link playlists to a userid

+ fix favorites foreign key
+ add migration to add userid foreign key to playlists table
This commit is contained in:
cwilvx
2024-06-09 11:08:18 +03:00
parent 8fa64b3a4d
commit fcf1469428
6 changed files with 102 additions and 41 deletions
+4 -4
View File
@@ -9,16 +9,16 @@ CREATE TABLE IF NOT EXISTS playlists (
last_updated text not null,
name text not null,
settings text,
trackhashes text
trackhashes text,
userid integer not null,
constraint fk_users foreign key (userid) references users(id) on delete cascade
);
CREATE TABLE IF NOT EXISTS favorites (
id integer PRIMARY KEY,
hash text not null,
type text not null,
timestamp integer not null default 0,
userid integer not null,
foreign key (userid) references users(id) on delete cascade
timestamp integer not null default 0
);
CREATE TABLE IF NOT EXISTS settings (