title varchar(200) not null,
collapsed bool not null default false,
order_id integer not null default 0,
+ parent_cat integer,
+ index(parent_cat),
+ foreign key (parent_cat) references ttrss_feed_categories(id) ON DELETE SET NULL,
index(owner_uid),
foreign key (owner_uid) references ttrss_users(id) ON DELETE CASCADE) ENGINE=InnoDB DEFAULT CHARSET=UTF8;
create table ttrss_version (schema_version int not null) ENGINE=InnoDB DEFAULT CHARSET=UTF8;
-insert into ttrss_version values (92);
+insert into ttrss_version values (93);
create table ttrss_enclosures (id integer primary key auto_increment,
content_url text not null,
owner_uid integer not null references ttrss_users(id) on delete cascade,
collapsed boolean not null default false,
order_id integer not null default 0,
+ parent_cat integer references ttrss_feed_categories(id) on delete set null,
title varchar(200) not null);
create table ttrss_feeds (id serial not null primary key,
create table ttrss_version (schema_version int not null);
-insert into ttrss_version values (92);
+insert into ttrss_version values (93);
create table ttrss_enclosures (id serial not null primary key,
content_url text not null,
--- /dev/null
+begin;
+
+alter table ttrss_feed_categories add column parent_cat integer;
+update ttrss_feed_categories set parent_cat = NULL;
+
+alter table ttrss_feed_categories add FOREIGN KEY (parent_cat) REFERENCES ttrss_feed_categories(id) ON DELETE SET NULL;
+
+update ttrss_version set schema_version = 93;
+
+commit;
--- /dev/null
+begin;
+
+alter table ttrss_feed_categories add column parent_cat integer;
+update ttrss_feed_categories set parent_cat = NULL;
+
+alter table ttrss_feed_categories add constraint "$2" FOREIGN KEY (parent_cat) REFERENCES ttrss_feed_categories(id) ON DELETE SET NULL;
+
+update ttrss_version set schema_version = 93;
+
+commit;