]> git.ktnx.net Git - mpd-feeder.git/blob - sql/pgsql/init.sql
74598fd3d7242740bd98d333502a8ebc769dfaea
[mpd-feeder.git] / sql / pgsql / init.sql
1 begin transaction;
2
3 create table songs(
4     path text not null primary key,
5     artist text,
6     album text,
7     last_queued timestamp with time zone,
8     generation bigint not null);
9
10 create index songs_artist_idx on songs(artist);
11 create index songs_album_idx on songs(album);
12
13 create table albums(
14     artist text not null,
15     album text not null,
16     last_queued timestamp with time zone,
17     generation bigint not null,
18     primary key(album,artist));
19
20 create table artists(
21     artist text not null primary key,
22     last_queued timestamp with time zone,
23     generation bigint not null);
24
25 create table blacklisted_albums(
26     artist text not null,
27     album text not null,
28     generation bigint not null,
29     primary key(album,artist));
30
31 create table blacklisted_artists(
32     artist text not null primary key,
33     generation bigint not null
34 );
35
36 create table options(
37     generation bigint not null
38 );
39
40 insert into options(generation) values(0);
41
42 commit;