]> git.wh0rd.org - tt-rss.git/blobdiff - schema/ttrss_schema_mysql.sql
implement settings profiles (bump schema)
[tt-rss.git] / schema / ttrss_schema_mysql.sql
index ba9e8d431b71bf7d9e2d0d76515fd0043f118ee3..862ae3a428436eb5a93e75327480b2fb9e32e940 100644 (file)
@@ -15,6 +15,7 @@ drop table if exists ttrss_prefs_types;
 drop table if exists ttrss_prefs_sections; 
 drop table if exists ttrss_tags;
 drop table if exists ttrss_enclosures;
+drop table if exists ttrss_settings_profiles;
 drop table if exists ttrss_entry_comments;
 drop table if exists ttrss_user_entries;
 drop table if exists ttrss_entries;
@@ -22,6 +23,7 @@ drop table if exists ttrss_scheduled_updates;
 drop table if exists ttrss_counters_cache;
 drop table if exists ttrss_cat_counters_cache;
 drop table if exists ttrss_feeds;
+drop table if exists ttrss_archived_feeds;
 drop table if exists ttrss_feed_categories;
 drop table if exists ttrss_users;
 drop table if exists ttrss_themes;
@@ -62,6 +64,14 @@ create table ttrss_feed_categories(id integer not null primary key auto_incremen
        index(owner_uid),
        foreign key (owner_uid) references ttrss_users(id) ON DELETE CASCADE) TYPE=InnoDB;
 
+create table ttrss_archived_feeds (id integer not null primary key,
+       owner_uid integer not null,
+       title varchar(200) not null, 
+       feed_url text not null, 
+       site_url varchar(250) not null default '',
+       index(owner_uid),
+       foreign key (owner_uid) references ttrss_users(id) ON DELETE CASCADE) TYPE=InnoDB;
+
 create table ttrss_counters_cache (
        feed_id integer not null,
        owner_uid integer not null,
@@ -100,6 +110,7 @@ create table ttrss_feeds (id integer not null auto_increment primary key,
        auth_pass_encrypted boolean not null default false,
        last_viewed datetime default null,
        last_update_started datetime default null,
+       always_display_enclosures boolean not null default false,
        update_method integer not null default 0,
        index(owner_uid),
        foreign key (owner_uid) references ttrss_users(id) ON DELETE CASCADE,
@@ -132,7 +143,8 @@ create index ttrss_entries_date_entered_index on ttrss_entries(date_entered);
 create table ttrss_user_entries (
        int_id integer not null primary key auto_increment,
        ref_id integer not null,
-       feed_id int not null, 
+       feed_id int, 
+       orig_feed_id int, 
        owner_uid integer not null,
        marked bool not null default 0,
        published bool not null default 0,
@@ -144,6 +156,8 @@ create table ttrss_user_entries (
        foreign key (ref_id) references ttrss_entries(id) ON DELETE CASCADE,
        index (feed_id),
        foreign key (feed_id) references ttrss_feeds(id) ON DELETE CASCADE,
+       index (orig_feed_id),
+       foreign key (orig_feed_id) references ttrss_archived_feeds(id) ON DELETE SET NULL,
        index (owner_uid),
        foreign key (owner_uid) references ttrss_users(id) ON DELETE CASCADE) TYPE=InnoDB;
 
@@ -225,9 +239,9 @@ create table ttrss_tags (id integer primary key auto_increment,
 
 create table ttrss_version (schema_version int not null) TYPE=InnoDB;
 
-insert into ttrss_version values (56);
+insert into ttrss_version values (63);
 
-create table ttrss_enclosures (id serial not null primary key,
+create table ttrss_enclosures (id integer primary key auto_increment,
        content_url text not null,
        content_type varchar(250) not null,
        post_id integer not null,
@@ -236,6 +250,12 @@ create table ttrss_enclosures (id serial not null primary key,
        index (post_id),
        foreign key (post_id) references ttrss_entries(id) ON DELETE cascade) TYPE=InnoDB;
 
+create table ttrss_settings_profiles(id integer primary key auto_increment,
+       title varchar(250) not null,
+       owner_uid integer not null,
+       index (owner_uid),
+       foreign key (owner_uid) references ttrss_users(id) ON DELETE CASCADE) TYPE=InnoDB;
+
 create table ttrss_prefs_types (id integer not null primary key, 
        type_name varchar(100) not null) TYPE=InnoDB;
 
@@ -269,8 +289,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.');
@@ -358,10 +378,33 @@ insert into ttrss_prefs (pref_name,type_id,def_value,short_desc,section_id) valu
 
 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,
    pref_name varchar(250),
    value text not null,
+       profile integer,
+       index (profile),
+       foreign key (profile) references ttrss_settings_profiles(id) ON DELETE CASCADE,
        index (owner_uid),
        foreign key (owner_uid) references ttrss_users(id) ON DELETE CASCADE,
        index (pref_name),