aboutsummaryrefslogtreecommitdiffstats
path: root/schema.sql
diff options
context:
space:
mode:
authorThibaut Horel <thibaut.horel@gmail.com>2017-06-07 01:15:43 -0400
committerThibaut Horel <thibaut.horel@gmail.com>2017-06-07 01:15:43 -0400
commit3543fcb861a122fe3405bf42f83f6dbc56888b8c (patch)
tree30ba1b2057e54754433b7ced0d90dc6993abf3f2 /schema.sql
parentb235490206f5aea8b1c618e7ffdae20ef052e78d (diff)
downloadlastfm-api-3543fcb861a122fe3405bf42f83f6dbc56888b8c.tar.gz
Get additional song metadata from last.fm
Diffstat (limited to 'schema.sql')
-rw-r--r--schema.sql25
1 files changed, 16 insertions, 9 deletions
diff --git a/schema.sql b/schema.sql
index f875137..b65ae6b 100644
--- a/schema.sql
+++ b/schema.sql
@@ -17,17 +17,29 @@ CREATE TABLE IF NOT EXISTS scrobbling_sessions (
protocol text,
created timestamptz DEFAULT current_timestamp
);
+
+CREATE TABLE IF NOT EXISTS songs (
+ song_id SERIAL PRIMARY KEY,
+ artist text,
+ album text,
+ name text,
+ track_number text,
+ duration text,
+ mbid text,
+ image text
+);
+
CREATE TABLE IF NOT EXISTS scrobbles (
artist text,
- albumartist text,
- trackname text,
+ album_artist text,
+ track_name text,
album text,
- tracknumber int,
+ track_number int,
duration int,
time timestamptz,
chosen bool,
mbid text,
- mbid_computed text,
+ song_id int REFERENCES songs,
session_key text REFERENCES scrobbling_sessions,
user_id int REFERENCES users
);
@@ -37,8 +49,3 @@ CREATE TABLE IF NOT EXISTS user_sessions (
user_id integer REFERENCES users,
created timestamptz DEFAULT current_timestamp
);
-
-CREATE TABLE IF NOT EXISTS songs (
- mbid text PRIMARY KEY,
- image text
-);