]> git.wh0rd.org - tt-rss.git/blame - schema/ttrss_schema_pgsql.sql
fix tiny prefs.php layout bug
[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
e0257be1
AD
89drop table ttrss_prefs;
90drop table ttrss_prefs_types;
91drop table ttrss_prefs_sections;
92
93create table ttrss_prefs_types (id integer primary key,
94 type_name varchar(100) not null);
95
96insert into ttrss_prefs_types (id, type_name) values (1, 'bool');
97insert into ttrss_prefs_types (id, type_name) values (2, 'string');
98insert into ttrss_prefs_types (id, type_name) values (3, 'integer');
99
100create table ttrss_prefs_sections (id integer primary key,
101 section_name varchar(100) not null);
102
603e9ebe
AD
103insert into ttrss_prefs_sections (id, section_name) values (1, 'General');
104insert into ttrss_prefs_sections (id, section_name) values (2, 'Interface');
650bc435 105insert into ttrss_prefs_sections (id, section_name) values (3, 'Advanced');
e0257be1
AD
106
107create table ttrss_prefs (pref_name varchar(250) primary key,
108 type_id integer not null references ttrss_prefs_types(id),
109 section_id integer not null references ttrss_prefs_sections(id) default 1,
603e9ebe
AD
110 short_desc text not null,
111 help_text text not null default '',
e0257be1
AD
112 def_value text not null,
113 value text not null);
114
4338e23d
AD
115insert into ttrss_prefs (pref_name,type_id,value,def_value,short_desc,section_id) values('ENABLE_FEED_ICONS', 1, 'true', 'true', 'Enable icons in feedlist',2);
116insert into ttrss_prefs (pref_name,type_id,value,def_value,short_desc,section_id) values('ICONS_DIR', 2, 'icons', 'icons', 'Local directory for feed icons',1);
117insert into ttrss_prefs (pref_name,type_id,value,def_value,short_desc,section_id) values('ICONS_URL', 2, 'icons', 'icons', 'Local URL for icons',1);
118insert into ttrss_prefs (pref_name,type_id,value,def_value,short_desc,section_id) values('PURGE_OLD_DAYS', 3, '60', '60', 'Purge old posts after this number of days (0 - disables)',1);
119insert into ttrss_prefs (pref_name,type_id,value,def_value,short_desc,section_id) values('UPDATE_POST_ON_CHECKSUM_CHANGE', 1, 'true', 'true', 'Update post on checksum change',1);
120insert into ttrss_prefs (pref_name,type_id,value,def_value,short_desc,section_id) values('ENABLE_PREFS_CATCHUP_UNCATCHUP', 1, 'false', 'false', 'Enable catchup/uncatchup buttons in feed editor',2);
650bc435 121insert into ttrss_prefs (pref_name,type_id,value,def_value,short_desc,section_id,help_text) values('ENABLE_LABELS', 1, 'false', 'false', 'Enable labels',3,
36990e33
AD
122 'Experimental support for virtual feeds based on user crafted SQL queries. This feature is highly experimental and at this point not user friendly. Use with caution.');
123
4338e23d
AD
124insert into ttrss_prefs (pref_name,type_id,value,def_value,short_desc,section_id) values('DEFAULT_UPDATE_INTERVAL', 3, '30', '30', 'Default interval between feed updates (in minutes)',1);
125insert into ttrss_prefs (pref_name,type_id,value,def_value,short_desc,section_id) values('DISPLAY_HEADER', 1, 'true', 'true', 'Display header',2);
126insert into ttrss_prefs (pref_name,type_id,value,def_value,short_desc,section_id) values('DISPLAY_FOOTER', 1, 'true', 'true', 'Display footer',2);
127insert into ttrss_prefs (pref_name,type_id,value,def_value,short_desc,section_id) values('USE_COMPACT_STYLESHEET', 1, 'false', 'false', 'Use compact stylesheet by default',2);
36990e33
AD
128insert into ttrss_prefs (pref_name,type_id,value,def_value,short_desc,section_id,help_text) values('DEFAULT_ARTICLE_LIMIT', 3, '0', '0', 'Default article limit',2,
129 'Default limit for articles to display, any custom number you like (0 - disables).');
130
650bc435 131insert into ttrss_prefs (pref_name,type_id,value,def_value,short_desc,section_id,help_text) values('DAEMON_REFRESH_ONLY', 1, 'false', 'false', 'Daemon refresh only', 3,
36990e33
AD
132 'Updates to all feeds will only run when the backend script is invoked with a "daemon" option on the URI stem.');
133
134insert into ttrss_prefs (pref_name,type_id,value,def_value,short_desc,section_id,help_text) values('DISPLAY_FEEDLIST_ACTIONS', 1, 'false', 'false', 'Display feedlist actions',2,
135 'Display separate dropbox for feedlist actions, if disabled these actions are available in global actions menu.');
136
4338e23d 137insert into ttrss_prefs (pref_name,type_id,value,def_value,short_desc,section_id) values('ENABLE_SPLASH', 1, 'false', 'false', 'Enable loading splashscreen',2);
e0257be1 138