--- /dev/null
+begin;
+
+alter table ttrss_feeds add column last_error text;
+alter table ttrss_feeds add column site_url varchar(250);
+alter table ttrss_feeds add column update_interval integer;
+
+update ttrss_feeds set last_error = '';
+update ttrss_feeds set site_url = '';
+update ttrss_feeds set update_interval = 0;
+
+alter table ttrss_feeds alter column last_error set not null;
+alter table ttrss_feeds alter column last_error set default '';
+
+alter table ttrss_feeds alter column site_url set not null;
+alter table ttrss_feeds alter column site_url set default '';
+
+alter table ttrss_feeds alter column update_interval set not null;
+alter table ttrss_feeds alter column update_interval set default 0;
+
+create table ttrss_version (schema_version int not null);
+
+insert into ttrss_version values (1);
+
+commit;
--- /dev/null
+begin;
+
+alter table ttrss_entries add column num_comments integer;
+
+update ttrss_entries set num_comments = 0;
+
+alter table ttrss_entries change num_comments num_comments integer not null;
+alter table ttrss_entries alter column num_comments set default 0;
+
+insert into ttrss_prefs (pref_name,type_id,def_value,short_desc,section_id,help_text) values('COMBINED_DISPLAY_MODE', 1, 'false', 'Combined feed display',2,
+ 'Display expanded list of feed articles, instead of separate displays for headlines and article content');
+
+alter table ttrss_feed_categories add column collapsed bool;
+
+update ttrss_feed_categories set collapsed = false;
+
+alter table ttrss_feed_categories change collapsed collapsed bool not null;
+alter table ttrss_feed_categories alter column collapsed set default 0;
+
+alter table ttrss_feeds add column auth_login varchar(250);
+alter table ttrss_feeds add column auth_pass varchar(250);
+
+update ttrss_feeds set auth_login = '';
+update ttrss_feeds set auth_pass = '';
+
+alter table ttrss_feeds change auth_login auth_login varchar(250) not null;
+alter table ttrss_feeds alter column auth_login set default '';
+
+alter table ttrss_feeds change auth_pass auth_pass varchar(250) not null;
+alter table ttrss_feeds alter column auth_pass set default '';
+
+alter table ttrss_users add column email varchar(250);
+
+update ttrss_users set email = '';
+
+alter table ttrss_users change email email varchar(250) not null;
+alter table ttrss_users alter column email set default '';
+
+insert into ttrss_prefs (pref_name,type_id,def_value,short_desc,section_id) values('ENABLE_SEARCH_TOOLBAR', 1, 'false', 'Enable search toolbar',2);
+
+update ttrss_version set schema_version = 3;
+
+commit;
--- /dev/null
+begin;
+
+alter table ttrss_entries add column num_comments integer;
+
+update ttrss_entries set num_comments = 0;
+
+alter table ttrss_entries alter column num_comments set not null;
+alter table ttrss_entries alter column num_comments set default 0;
+
+insert into ttrss_prefs (pref_name,type_id,def_value,short_desc,section_id,help_text) values('COMBINED_DISPLAY_MODE', 1, 'false', 'Combined feed display',2,
+ 'Display expanded list of feed articles, instead of separate displays for headlines and article content');
+
+alter table ttrss_feed_categories add column collapsed boolean;
+
+update ttrss_feed_categories set collapsed = false;
+
+alter table ttrss_feed_categories alter column collapsed set not null;
+alter table ttrss_feed_categories alter column collapsed set default false;
+
+alter table ttrss_feeds add column auth_login varchar(250);
+alter table ttrss_feeds add column auth_pass varchar(250);
+
+update ttrss_feeds set auth_login = '';
+update ttrss_feeds set auth_pass = '';
+
+alter table ttrss_feeds alter column auth_login set not null;
+alter table ttrss_feeds alter column auth_login set default '';
+
+alter table ttrss_feeds alter column auth_pass set not null;
+alter table ttrss_feeds alter column auth_pass set default '';
+
+alter table ttrss_users add column email varchar(250);
+
+update ttrss_users set email = '';
+
+alter table ttrss_users alter column email set not null;
+alter table ttrss_users alter column email set default '';
+
+insert into ttrss_prefs (pref_name,type_id,def_value,short_desc,section_id) values('ENABLE_SEARCH_TOOLBAR', 1, 'false', 'Enable search toolbar',2);
+
+update ttrss_version set schema_version = 3;
+
+commit;
site_url varchar(250) not null default '',
auth_login varchar(250) not null default '',
auth_pass varchar(250) not null default '',
+ parent_feed integer default null,
index(owner_uid),
foreign key (owner_uid) references ttrss_users(id) ON DELETE CASCADE,
index(cat_id),
- foreign key (cat_id) references ttrss_feed_categories(id)) TYPE=InnoDB;
+ foreign key (cat_id) references ttrss_feed_categories(id),
+ index(parent_feed),
+ foreign key (parent_feed) references ttrss_feeds(id) ON DELETE SET NULL) TYPE=InnoDB;
insert into ttrss_feeds (owner_uid,title,feed_url) values (1,'Footnotes', 'http://gnomedesktop.org/node/feed');
insert into ttrss_feeds (owner_uid,title,feed_url) values (1,'Latest Linux Kernel Versions','http://kernel.org/kdist/rss.xml');
last_error text not null default '',
site_url varchar(250) not null default '',
auth_login varchar(250) not null default '',
- auth_pass varchar(250) not null default '');
+ parent_feed integer default null references ttrss_feeds(id) on delete set null,
+ auth_pass varchar(250) not null default '');
create index ttrss_feeds_owner_uid_index on ttrss_feeds(owner_uid);
+++ /dev/null
-begin;
-
-alter table ttrss_feeds add column last_error text;
-alter table ttrss_feeds add column site_url varchar(250);
-alter table ttrss_feeds add column update_interval integer;
-
-update ttrss_feeds set last_error = '';
-update ttrss_feeds set site_url = '';
-update ttrss_feeds set update_interval = 0;
-
-alter table ttrss_feeds alter column last_error set not null;
-alter table ttrss_feeds alter column last_error set default '';
-
-alter table ttrss_feeds alter column site_url set not null;
-alter table ttrss_feeds alter column site_url set default '';
-
-alter table ttrss_feeds alter column update_interval set not null;
-alter table ttrss_feeds alter column update_interval set default 0;
-
-create table ttrss_version (schema_version int not null);
-
-insert into ttrss_version values (1);
-
-commit;
+++ /dev/null
-begin;
-
-alter table ttrss_entries add column num_comments integer;
-
-update ttrss_entries set num_comments = 0;
-
-alter table ttrss_entries change num_comments num_comments integer not null;
-alter table ttrss_entries alter column num_comments set default 0;
-
-insert into ttrss_prefs (pref_name,type_id,def_value,short_desc,section_id,help_text) values('COMBINED_DISPLAY_MODE', 1, 'false', 'Combined feed display',2,
- 'Display expanded list of feed articles, instead of separate displays for headlines and article content');
-
-alter table ttrss_feed_categories add column collapsed bool;
-
-update ttrss_feed_categories set collapsed = false;
-
-alter table ttrss_feed_categories change collapsed collapsed bool not null;
-alter table ttrss_feed_categories alter column collapsed set default 0;
-
-alter table ttrss_feeds add column auth_login varchar(250);
-alter table ttrss_feeds add column auth_pass varchar(250);
-
-update ttrss_feeds set auth_login = '';
-update ttrss_feeds set auth_pass = '';
-
-alter table ttrss_feeds change auth_login auth_login varchar(250) not null;
-alter table ttrss_feeds alter column auth_login set default '';
-
-alter table ttrss_feeds change auth_pass auth_pass varchar(250) not null;
-alter table ttrss_feeds alter column auth_pass set default '';
-
-alter table ttrss_users add column email varchar(250);
-
-update ttrss_users set email = '';
-
-alter table ttrss_users change email email varchar(250) not null;
-alter table ttrss_users alter column email set default '';
-
-insert into ttrss_prefs (pref_name,type_id,def_value,short_desc,section_id) values('ENABLE_SEARCH_TOOLBAR', 1, 'false', 'Enable search toolbar',2);
-
-update ttrss_version set schema_version = 3;
-
-commit;
+++ /dev/null
-begin;
-
-alter table ttrss_entries add column num_comments integer;
-
-update ttrss_entries set num_comments = 0;
-
-alter table ttrss_entries alter column num_comments set not null;
-alter table ttrss_entries alter column num_comments set default 0;
-
-insert into ttrss_prefs (pref_name,type_id,def_value,short_desc,section_id,help_text) values('COMBINED_DISPLAY_MODE', 1, 'false', 'Combined feed display',2,
- 'Display expanded list of feed articles, instead of separate displays for headlines and article content');
-
-alter table ttrss_feed_categories add column collapsed boolean;
-
-update ttrss_feed_categories set collapsed = false;
-
-alter table ttrss_feed_categories alter column collapsed set not null;
-alter table ttrss_feed_categories alter column collapsed set default false;
-
-alter table ttrss_feeds add column auth_login varchar(250);
-alter table ttrss_feeds add column auth_pass varchar(250);
-
-update ttrss_feeds set auth_login = '';
-update ttrss_feeds set auth_pass = '';
-
-alter table ttrss_feeds alter column auth_login set not null;
-alter table ttrss_feeds alter column auth_login set default '';
-
-alter table ttrss_feeds alter column auth_pass set not null;
-alter table ttrss_feeds alter column auth_pass set default '';
-
-alter table ttrss_users add column email varchar(250);
-
-update ttrss_users set email = '';
-
-alter table ttrss_users alter column email set not null;
-alter table ttrss_users alter column email set default '';
-
-insert into ttrss_prefs (pref_name,type_id,def_value,short_desc,section_id) values('ENABLE_SEARCH_TOOLBAR', 1, 'false', 'Enable search toolbar',2);
-
-update ttrss_version set schema_version = 3;
-
-commit;
--- /dev/null
+begin;
+
+alter table ttrss_feeds add column parent_feed integer;
+alter table ttrss_feeds add foreign key (parent_feed) references ttrss_feeds(id) on delete set null;
+
+commit;
--- /dev/null
+begin;
+
+alter table ttrss_feeds add column parent_feed integer;
+alter table ttrss_feeds add foreign key (parent_feed) references ttrss_feeds(id) on delete set null;
+
+commit;