+drop table ttrss_user_labels2;
+drop table ttrss_labels2;
+drop table ttrss_feedbrowser_cache;
drop table ttrss_version;
drop table ttrss_labels;
drop table ttrss_filters;
drop table ttrss_entries;
drop table ttrss_scheduled_updates;
drop table ttrss_counters_cache;
+drop table ttrss_cat_counters_cache;
drop table ttrss_feeds;
drop table ttrss_feed_categories;
drop table ttrss_users;
(1, 'Tiny Tiny RSS: Forum', 'http://tt-rss.spb.ru/forum/rss.php');
create table ttrss_counters_cache (
- feed_id integer not null references ttrss_feeds(id) ON DELETE CASCADE,
+ feed_id integer not null,
owner_uid integer not null references ttrss_users(id) ON DELETE CASCADE,
+ updated timestamp not null,
+ value integer not null default 0);
+
+create table ttrss_cat_counters_cache (
+ feed_id integer not null,
+ owner_uid integer not null references ttrss_users(id) ON DELETE CASCADE,
+ updated timestamp not null,
value integer not null default 0);
create table ttrss_entries (id serial not null primary key,
published boolean not null default false,
last_read timestamp,
score int not null default 0,
+ note text,
unread boolean not null default true);
-- create index ttrss_user_entries_feed_id_index on ttrss_user_entries(feed_id);
'Title or Content');
insert into ttrss_filter_types (id,name,description) values (4, 'link',
'Link');
+insert into ttrss_filter_types (id,name,description) values (5, 'date',
+ 'Article Date');
create table ttrss_filter_actions (id integer not null primary key,
name varchar(120) unique not null,
insert into ttrss_filter_actions (id,name,description) values (6, 'score',
'Modify score');
+insert into ttrss_filter_actions (id,name,description) values (7, 'label',
+ 'Assign label');
+
create table ttrss_filters (id serial not null primary key,
owner_uid integer not null references ttrss_users(id) on delete cascade,
feed_id integer references ttrss_feeds(id) on delete cascade default null,
filter_type integer not null references ttrss_filter_types(id),
reg_exp varchar(250) not null,
+ filter_param varchar(250) not null default '',
enabled boolean not null default true,
inverse boolean not null default false,
action_id integer not null default 1 references ttrss_filter_actions(id) on delete cascade,
action_param varchar(250) not null default '');
-create table ttrss_labels (id serial not null primary key,
- owner_uid integer not null references ttrss_users(id) on delete cascade,
- sql_exp text not null,
- description varchar(250) not null);
-
-create index ttrss_labels_owner_uid_index on ttrss_labels(owner_uid);
-
-insert into ttrss_labels (owner_uid,sql_exp,description) values (1,'unread = true',
- 'Unread articles');
-
-insert into ttrss_labels (owner_uid,sql_exp,description) values (1,
- 'last_read is null and unread = false', 'Updated articles');
-
create table ttrss_tags (id serial not null primary key,
tag_name varchar(250) not null,
owner_uid integer not null references ttrss_users(id) on delete cascade,
create table ttrss_version (schema_version int not null);
-insert into ttrss_version values (44);
+insert into ttrss_version values (55);
create table ttrss_enclosures (id serial not null primary key,
content_url text not null,
insert into ttrss_prefs (pref_name,type_id,def_value,short_desc,section_id) values('CONFIRM_FEED_CATCHUP', 1, 'true', 'Confirm marking feed as read',3);
insert into ttrss_prefs (pref_name,type_id,def_value,short_desc,section_id,help_text) values('CDM_AUTO_CATCHUP', 1, 'false', 'Mark articles as read automatically',2,
-'This option enables marking articles as read automatically in combined mode while you scroll article list.');
+'This option enables marking articles as read automatically in combined mode (except for Fresh articles feed) while you scroll article list.');
insert into ttrss_prefs (pref_name,type_id,def_value,short_desc,section_id) values('_DEFAULT_VIEW_MODE', 2, 'adaptive', '', 1);
insert into ttrss_prefs (pref_name,type_id,def_value,short_desc,section_id) values('_DEFAULT_VIEW_ORDER_BY', 2, 'default', '', 1);
+insert into ttrss_prefs (pref_name,type_id,def_value,short_desc,section_id,help_text) values('ENABLE_OFFLINE_READING', 1, 'false', 'Enable offline reading',1, 'Synchronize new articles for offline reading using Google Gears.');
+
create table ttrss_user_prefs (
owner_uid integer not null references ttrss_users(id) ON DELETE CASCADE,
pref_name varchar(250) not null references ttrss_prefs(pref_name) ON DELETE CASCADE,
create function SUBSTRING_FOR_DATE(timestamp, int, int) RETURNS text AS 'SELECT SUBSTRING(CAST($1 AS text), $2, $3)' LANGUAGE 'sql';
+create table ttrss_feedbrowser_cache (
+ feed_url text not null primary key,
+ title text not null,
+ subscribers integer not null);
+
+create table ttrss_labels2 (id serial not null primary key,
+ owner_uid integer not null references ttrss_users(id) ON DELETE CASCADE,
+ fg_color varchar(15) not null default '',
+ bg_color varchar(15) not null default '',
+ caption varchar(250) not null
+);
+
+create table ttrss_user_labels2 (
+ label_id integer not null references ttrss_labels2(id) ON DELETE CASCADE,
+ article_id integer not null references ttrss_entries(id) ON DELETE CASCADE
+);
+
commit;