diff options
Diffstat (limited to 'schema.sql')
| -rw-r--r-- | schema.sql | 25 |
1 files changed, 16 insertions, 9 deletions
@@ -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 -); |
