From 3543fcb861a122fe3405bf42f83f6dbc56888b8c Mon Sep 17 00:00:00 2001
From: Thibaut Horel <thibaut.horel@gmail.com>
Date: Wed, 7 Jun 2017 01:15:43 -0400
Subject: Get additional song metadata from last.fm

---
 schema.sql | 25 ++++++++++++++++---------
 1 file changed, 16 insertions(+), 9 deletions(-)

(limited to 'schema.sql')

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
-);
-- 
cgit v1.2.3-70-g09d2

