aboutsummaryrefslogtreecommitdiffstats
path: root/schema.sql
blob: fb13dc768fa45df788a87f9f379a9aa2c974aea0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
CREATE TABLE IF NOT EXISTS scrobbling_sessions (
	lfm_name text,
    key text PRIMARY KEY,
    client text,
    protocol text,
	created timestamptz DEFAULT current_timestamp
);

CREATE TABLE IF NOT EXISTS scrobbles (
	artist      text,
	albumartist text,
	trackname   text,
	album       text,
	tracknumber int,
	duration    int,
	time        timestamptz,
	chosen      bool,
	mbid        text,
	session     text
);

CREATE TABLE IF NOT EXISTS users (
	user_id SERIAL PRIMARY KEY,
	type text,
	op_id text,
	name text,
	email text,
	lfm_name text,
	lfm_password text
);

CREATE TABLE IF NOT EXISTS user_sessions (
	id text PRIMARY KEY,
	user_id integer REFERENCES users
);

CREATE TABLE IF NOT EXISTS songs (
	mbid text PRIMARY KEY,
	image text
);