]> git.wh0rd.org - tt-rss.git/blobdiff - schema/ttrss_schema_pgsql.sql
Revert "update translations"
[tt-rss.git] / schema / ttrss_schema_pgsql.sql
index 9d716f235f12e44f919324b6a2a9c1bee890b907..57d2e95d173403621e4c3ebec8a4017e44f18a5d 100644 (file)
@@ -1,3 +1,6 @@
+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;
@@ -14,6 +17,7 @@ drop table ttrss_user_entries;
 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;
@@ -85,8 +89,15 @@ insert into ttrss_feeds (owner_uid, title, feed_url) values
        (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, 
@@ -115,6 +126,7 @@ create table ttrss_user_entries (
        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);
@@ -141,6 +153,8 @@ insert into ttrss_filter_types (id,name,description) values (3, 'both',
        '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, 
@@ -164,29 +178,20 @@ insert into ttrss_filter_actions (id,name,description) values (5, 'publish',
 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,
@@ -196,7 +201,7 @@ create index ttrss_tags_owner_uid_index on ttrss_tags(owner_uid);
 
 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,
@@ -276,7 +281,7 @@ insert into ttrss_prefs (pref_name,type_id,def_value,short_desc,section_id,help_
 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);
 
@@ -321,6 +326,8 @@ insert into ttrss_prefs (pref_name,type_id,def_value,short_desc,section_id,help_
 
 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,
@@ -342,4 +349,21 @@ create index ttrss_sessions_expire_index on ttrss_sessions(expire);
 
 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;