summaryrefslogtreecommitdiff
path: root/dbschema.sql
blob: 2fcf0c9e1a7e2785a73ed87eb122bdd6eb0cba3c (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
-- Could have saved two table here. But having them avoids redundancy as well as
-- make it possible for future enhancements.

CREATE TABLE artist (
	name varchar(200) NOT NULL,
	PRIMARY KEY(name)
);

CREATE TABLE song (
	title varchar(200) NOT NULL,
	album varchar(200),
	artistname varchar(200),
	genrename varchar(200),
	filepath varchar(255),
	year int,
	track varchar(8),
	extension varchar(50),
	mtime int,
	PRIMARY KEY(title, artistname, album, year)
);

CREATE TABLE genre (
	name varchar(200) NOT NULL,
	PRIMARY KEY(name)
);