]> git.wh0rd.org - tt-rss.git/blobdiff - schema/ttrss_schema_pgsql.sql
implement settings profiles (bump schema)
[tt-rss.git] / schema / ttrss_schema_pgsql.sql
index f5907210da733d1a14194de306b2d932fa220c13..fb2ac18222fb7c10a8da73460dcd41f711741e37 100644 (file)
@@ -12,12 +12,14 @@ drop table ttrss_prefs_types;
 drop table ttrss_prefs_sections; 
 drop table ttrss_tags;
 drop table ttrss_enclosures;
+drop table ttrss_settings_profiles;
 drop table ttrss_entry_comments;
 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_archived_feeds;
 drop table ttrss_feeds;
 drop table ttrss_feed_categories;
 drop table ttrss_users;
@@ -78,6 +80,7 @@ create table ttrss_feeds (id serial not null primary key,
        last_viewed timestamp default null,
        last_update_started timestamp default null,
        update_method integer not null default 0,
+       always_display_enclosures boolean not null default false,
        auth_pass_encrypted boolean not null default false);    
 
 create index ttrss_feeds_owner_uid_index on ttrss_feeds(owner_uid);
@@ -88,6 +91,12 @@ insert into ttrss_feeds (owner_uid, title, feed_url) values
 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_archived_feeds (id integer not null primary key,
+       owner_uid integer not null references ttrss_users(id) on delete cascade,
+       title varchar(200) not null, 
+       feed_url text not null, 
+       site_url varchar(250) not null default '');     
+
 create table ttrss_counters_cache (
        feed_id integer not null,
        owner_uid integer not null references ttrss_users(id) ON DELETE CASCADE,
@@ -120,12 +129,14 @@ create index ttrss_entries_date_entered_index on ttrss_entries(date_entered);
 create table ttrss_user_entries (
        int_id serial not null primary key,
        ref_id integer not null references ttrss_entries(id) ON DELETE CASCADE,
-       feed_id int references ttrss_feeds(id) ON DELETE CASCADE not null, 
+       feed_id int references ttrss_feeds(id) ON DELETE CASCADE, 
+       orig_feed_id integer references ttrss_archived_feeds(id) ON DELETE SET NULL, 
        owner_uid integer not null references ttrss_users(id) ON DELETE CASCADE,
        marked boolean not null default false,
        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);
@@ -200,7 +211,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 (52);
+insert into ttrss_version values (63);
 
 create table ttrss_enclosures (id serial not null primary key,
        content_url text not null,
@@ -209,6 +220,10 @@ create table ttrss_enclosures (id serial not null primary key,
        duration text not null,
        post_id integer references ttrss_entries(id) ON DELETE cascade NOT NULL);
 
+create table ttrss_settings_profiles(id serial not null primary key,
+       title varchar(250) not null,
+       owner_uid integer not null references ttrss_users(id) on delete cascade);
+
 create table ttrss_prefs_types (id integer not null primary key, 
        type_name varchar(100) not null);
 
@@ -238,8 +253,8 @@ insert into ttrss_prefs (pref_name,type_id,def_value,short_desc,section_id,help_
        '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.');
        
 insert into ttrss_prefs (pref_name,type_id,def_value,short_desc,section_id) values('DEFAULT_UPDATE_INTERVAL', 3, '30', 'Default interval between feed updates (in minutes)',1);
-insert into ttrss_prefs (pref_name,type_id,def_value,short_desc,section_id,help_text) values('DEFAULT_ARTICLE_LIMIT', 3, '0', 'Default article limit',2,
-       'Default limit for articles to display, any custom number you like (0 - disables).');
+
+insert into ttrss_prefs (pref_name,type_id,def_value,short_desc,section_id) values('DEFAULT_ARTICLE_LIMIT', 3, '30', 'Amount of articles to display at once',2);
 
 insert into ttrss_prefs (pref_name,type_id,def_value,short_desc,section_id,help_text) values('ALLOW_DUPLICATE_POSTS', 1, 'true', 'Allow duplicate posts',1,
        'This option is useful when you are reading several planet-type aggregators with partially colliding userbase. When disabled, it forces same posts from different feeds to appear only once.');
@@ -325,9 +340,32 @@ 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.');
+
+insert into ttrss_prefs (pref_name,type_id,def_value,short_desc,section_id) values('ENABLE_API_ACCESS', 1, 'false', 'Enable external API', 3);
+
+insert into ttrss_prefs (pref_name,type_id,def_value,short_desc,section_id) values('_COLLAPSED_SPECIAL', 1, 'false', '', 1);
+
+insert into ttrss_prefs (pref_name,type_id,def_value,short_desc,section_id) values('_COLLAPSED_LABELS', 1, 'false', '', 1);
+
+insert into ttrss_prefs (pref_name,type_id,def_value,short_desc,section_id) values('_COLLAPSED_UNCAT', 1, 'false', '', 1);
+
+insert into ttrss_prefs (pref_name,type_id,def_value,short_desc,section_id) values('_COLLAPSED_FEEDLIST', 1, 'false', '', 1);
+
+insert into ttrss_prefs (pref_name,type_id,def_value,short_desc,section_id) values('_MOBILE_ENABLE_CATS', 1, 'false', '', 1);
+
+insert into ttrss_prefs (pref_name,type_id,def_value,short_desc,section_id) values('_MOBILE_SHOW_IMAGES', 1, 'false', '', 1);
+
+insert into ttrss_prefs (pref_name,type_id,def_value,short_desc,section_id) values('_MOBILE_HIDE_READ', 1, 'false', '', 1);
+
+insert into ttrss_prefs (pref_name,type_id,def_value,short_desc,section_id) values('_MOBILE_SORT_FEEDS_UNREAD', 1, 'false', '', 1);
+
+insert into ttrss_prefs (pref_name,type_id,def_value,short_desc,section_id) values('_THEME_ID', 3, '0', '', 1);
+
 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,
+       profile integer references ttrss_settings_profiles(id) ON DELETE CASCADE,
        value text not null);
 
 create index ttrss_user_prefs_owner_uid_index on ttrss_user_prefs(owner_uid);
@@ -353,15 +391,11 @@ create table ttrss_feedbrowser_cache (
 
 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
 );
 
---INSERT INTO ttrss_labels2 (owner_uid, caption) VALUES (1, 'All Articles');
---
---INSERT INTO ttrss_filters (owner_uid, feed_id, filter_type, reg_exp, enabled, 
---    action_id, action_param, filter_param) 
---    VALUES (1, NULL, 1, '.', true, 7, 'All Articles', 'before');
-
 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