]> git.wh0rd.org - tt-rss.git/blob - schema/ttrss_schema_pgsql.sql
3c084996f4ea85ab6650b874f0c575ab0dbc0048
[tt-rss.git] / schema / ttrss_schema_pgsql.sql
1 drop table ttrss_tags;
2 drop table ttrss_entries;
3 drop table ttrss_feeds;
4
5 create table ttrss_feeds (id serial not null primary key,
6 title varchar(200) not null unique,
7 feed_url varchar(250) unique not null,
8 icon_url varchar(250) not null default '',
9 last_updated timestamp default null);
10
11 insert into ttrss_feeds (title,feed_url) values ('Footnotes', 'http://gnomedesktop.org/node/feed');
12 insert into ttrss_feeds (title,feed_url) values ('Freedesktop.org', 'http://planet.freedesktop.org/rss20.xml');
13 insert into ttrss_feeds (title,feed_url) values ('Planet Debian', 'http://planet.debian.org/rss20.xml');
14 insert into ttrss_feeds (title,feed_url) values ('Planet GNOME', 'http://planet.gnome.org/rss20.xml');
15 insert into ttrss_feeds (title,feed_url) values ('Planet Ubuntu', 'http://planet.ubuntulinux.org/rss20.xml');
16
17 insert into ttrss_feeds (title,feed_url) values ('Monologue', 'http://www.go-mono.com/monologue/index.rss');
18
19 insert into ttrss_feeds (title,feed_url) values ('Latest Linux Kernel Versions',
20 'http://kernel.org/kdist/rss.xml');
21
22 insert into ttrss_feeds (title,feed_url) values ('RPGDot Newsfeed',
23 'http://www.rpgdot.com/team/rss/rss0.xml');
24
25 insert into ttrss_feeds (title,feed_url) values ('Digg.com News',
26 'http://digg.com/rss/index.xml');
27
28 insert into ttrss_feeds (title,feed_url) values ('Technocrat.net',
29 'http://syndication.technocrat.net/rss');
30
31 create table ttrss_entries (id serial not null primary key,
32 feed_id int references ttrss_feeds(id) ON DELETE CASCADE not null,
33 updated timestamp not null,
34 title varchar(250) not null,
35 guid varchar(300) not null unique,
36 link varchar(300) not null,
37 content text not null,
38 content_hash varchar(250) not null,
39 last_read timestamp,
40 marked boolean not null default false,
41 date_entered timestamp not null default NOW(),
42 no_orig_date boolean not null default false,
43 comments varchar(250) not null default '',
44 unread boolean not null default true);
45
46 drop table ttrss_filters;
47 drop table ttrss_filter_types;
48
49 create table ttrss_filter_types (id integer primary key,
50 name varchar(120) unique not null,
51 description varchar(250) not null unique);
52
53 insert into ttrss_filter_types (id,name,description) values (1, 'title', 'Title');
54 insert into ttrss_filter_types (id,name,description) values (2, 'content', 'Content');
55 insert into ttrss_filter_types (id,name,description) values (3, 'both',
56 'Title or Content');
57
58 create table ttrss_filters (id serial primary key,
59 filter_type integer not null references ttrss_filter_types(id),
60 reg_exp varchar(250) not null,
61 description varchar(250) not null default '');
62
63 drop table ttrss_labels;
64
65 create table ttrss_labels (id serial primary key,
66 sql_exp varchar(250) not null,
67 description varchar(250) not null);
68
69 insert into ttrss_labels (sql_exp,description) values ('unread = true',
70 'Unread articles');
71
72 create table ttrss_tags (id serial primary key,
73 tag_name varchar(250) not null,
74 post_id integer references ttrss_entries(id) ON DELETE CASCADE not null);
75