schema: set cat_id in ttrss_feeds to null when category is deleted
This commit is contained in:
parent
3b9e5af4b9
commit
f0907182c6
|
@ -80,7 +80,7 @@ create table ttrss_feeds (id integer not null auto_increment primary key,
|
||||||
index(owner_uid),
|
index(owner_uid),
|
||||||
foreign key (owner_uid) references ttrss_users(id) ON DELETE CASCADE,
|
foreign key (owner_uid) references ttrss_users(id) ON DELETE CASCADE,
|
||||||
index(cat_id),
|
index(cat_id),
|
||||||
foreign key (cat_id) references ttrss_feed_categories(id),
|
foreign key (cat_id) references ttrss_feed_categories(id) ON DELETE SET NULL,
|
||||||
index(parent_feed),
|
index(parent_feed),
|
||||||
foreign key (parent_feed) references ttrss_feeds(id) ON DELETE SET NULL) TYPE=InnoDB;
|
foreign key (parent_feed) references ttrss_feeds(id) ON DELETE SET NULL) TYPE=InnoDB;
|
||||||
|
|
||||||
|
|
|
@ -52,7 +52,7 @@ create table ttrss_feed_categories(id serial not null primary key,
|
||||||
create table ttrss_feeds (id serial not null primary key,
|
create table ttrss_feeds (id serial not null primary key,
|
||||||
owner_uid integer not null references ttrss_users(id) on delete cascade,
|
owner_uid integer not null references ttrss_users(id) on delete cascade,
|
||||||
title varchar(200) not null,
|
title varchar(200) not null,
|
||||||
cat_id integer references ttrss_feed_categories(id) default null,
|
cat_id integer default null references ttrss_feed_categories(id) on delete set null,
|
||||||
feed_url varchar(250) not null,
|
feed_url varchar(250) not null,
|
||||||
icon_url varchar(250) not null default '',
|
icon_url varchar(250) not null default '',
|
||||||
update_interval integer not null default 0,
|
update_interval integer not null default 0,
|
||||||
|
|
Loading…
Reference in New Issue