]> git.wh0rd.org - tt-rss.git/blame - schema/ttrss_schema_pgsql.sql
fix typo in mysql purge query
[tt-rss.git] / schema / ttrss_schema_pgsql.sql
CommitLineData
eb36b4eb 1drop table ttrss_tags;
28a80fbf
AD
2drop table ttrss_entries;
3drop table ttrss_feeds;
4
5create table ttrss_feeds (id serial not null primary key,
6 title varchar(200) not null unique,
7 feed_url varchar(250) unique not null,
b7f4bda2 8 icon_url varchar(250) not null default '',
d148926e 9 update_interval integer not null default 0,
1089b16b 10 purge_interval integer not null default 0,
ab3d0b99 11 last_updated timestamp default null,
37d379de
AD
12 last_error text not null default '',
13 site_url varchar(250) not null default '');
28a80fbf 14
a2015351
AD
15insert into ttrss_feeds (title,feed_url) values ('Footnotes', 'http://gnomedesktop.org/node/feed');
16insert into ttrss_feeds (title,feed_url) values ('Freedesktop.org', 'http://planet.freedesktop.org/rss20.xml');
17insert into ttrss_feeds (title,feed_url) values ('Planet Debian', 'http://planet.debian.org/rss20.xml');
18insert into ttrss_feeds (title,feed_url) values ('Planet GNOME', 'http://planet.gnome.org/rss20.xml');
466001c4
AD
19insert into ttrss_feeds (title,feed_url) values ('Planet Ubuntu', 'http://planet.ubuntulinux.org/rss20.xml');
20
a2015351 21insert into ttrss_feeds (title,feed_url) values ('Monologue', 'http://www.go-mono.com/monologue/index.rss');
857d6a80 22
a2015351 23insert into ttrss_feeds (title,feed_url) values ('Latest Linux Kernel Versions',
857d6a80
AD
24 'http://kernel.org/kdist/rss.xml');
25
a2015351 26insert into ttrss_feeds (title,feed_url) values ('RPGDot Newsfeed',
857d6a80
AD
27 'http://www.rpgdot.com/team/rss/rss0.xml');
28
a2015351 29insert into ttrss_feeds (title,feed_url) values ('Digg.com News',
857d6a80
AD
30 'http://digg.com/rss/index.xml');
31
19fc76c0 32insert into ttrss_feeds (title,feed_url) values ('Technocrat.net',
857d6a80 33 'http://syndication.technocrat.net/rss');
28a80fbf 34
28a80fbf 35create table ttrss_entries (id serial not null primary key,
eb36b4eb 36 feed_id int references ttrss_feeds(id) ON DELETE CASCADE not null,
d76a3b03 37 updated timestamp not null,
9ad5b0de 38 title text not null,
49a0dd3d
AD
39 guid text not null unique,
40 link text not null,
d76a3b03 41 content text not null,
466001c4 42 content_hash varchar(250) not null,
b197f117 43 last_read timestamp,
9a4506c8 44 marked boolean not null default false,
c3a8d71a 45 date_entered timestamp not null default NOW(),
b82af8c3 46 no_orig_date boolean not null default false,
a1ea1e12 47 comments varchar(250) not null default '',
b82af8c3 48 unread boolean not null default true);
a0d53889
AD
49
50drop table ttrss_filters;
51drop table ttrss_filter_types;
52
53create table ttrss_filter_types (id integer primary key,
54 name varchar(120) unique not null,
55 description varchar(250) not null unique);
56
57insert into ttrss_filter_types (id,name,description) values (1, 'title', 'Title');
58insert into ttrss_filter_types (id,name,description) values (2, 'content', 'Content');
59insert into ttrss_filter_types (id,name,description) values (3, 'both',
bdc00fe0 60 'Title or Content');
a0d53889
AD
61
62create table ttrss_filters (id serial primary key,
63 filter_type integer not null references ttrss_filter_types(id),
4b3dff6e 64 reg_exp varchar(250) not null,
a0d53889
AD
65 description varchar(250) not null default '');
66
48f0adb0
AD
67drop table ttrss_labels;
68
69create table ttrss_labels (id serial primary key,
70 sql_exp varchar(250) not null,
71 description varchar(250) not null);
72
48f0adb0
AD
73insert into ttrss_labels (sql_exp,description) values ('unread = true',
74 'Unread articles');
75
7cc6112a
AD
76insert into ttrss_labels (sql_exp,description) values (
77 'last_read is null and unread = false', 'Updated articles');
78
eb36b4eb
AD
79create table ttrss_tags (id serial primary key,
80 tag_name varchar(250) not null,
81 post_id integer references ttrss_entries(id) ON DELETE CASCADE not null);
82
5f171894
AD
83drop table ttrss_version;
84
85create table ttrss_version (schema_version int not null);
86
1089b16b 87insert into ttrss_version values (2);
5f171894 88