add ttrss_feed_categories.parent_cat, bump schema
This commit is contained in:
parent
9765e8b9f1
commit
ee0bc6edd9
|
@ -57,6 +57,9 @@ create table ttrss_feed_categories(id integer not null primary key auto_incremen
|
|||
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;
|
||||
|
||||
|
@ -267,7 +270,7 @@ create table ttrss_tags (id integer primary key auto_increment,
|
|||
|
||||
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,
|
||||
|
|
|
@ -52,6 +52,7 @@ create table ttrss_feed_categories(id serial not null primary key,
|
|||
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,
|
||||
|
@ -231,7 +232,7 @@ create index ttrss_tags_post_int_id_idx on ttrss_tags(post_int_id);
|
|||
|
||||
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,
|
||||
|
|
|
@ -0,0 +1,10 @@
|
|||
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;
|
|
@ -0,0 +1,10 @@
|
|||
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;
|
Loading…
Reference in New Issue