diff options
Diffstat (limited to 'schema')
-rw-r--r-- | schema/ttrss_schema_mysql.sql | 6 | ||||
-rw-r--r-- | schema/ttrss_schema_pgsql.sql | 4 | ||||
-rw-r--r-- | schema/versions/mysql/87.sql | 14 | ||||
-rw-r--r-- | schema/versions/pgsql/87.sql | 14 |
4 files changed, 36 insertions, 2 deletions
diff --git a/schema/ttrss_schema_mysql.sql b/schema/ttrss_schema_mysql.sql index 38a531095..04fa7f0de 100644 --- a/schema/ttrss_schema_mysql.sql +++ b/schema/ttrss_schema_mysql.sql @@ -233,6 +233,8 @@ create table ttrss_filters (id integer not null primary key auto_increment, filter_param varchar(250) not null default '', inverse bool not null default false, enabled bool not null default true, + cat_filter bool not null default false, + cat_id integer default null, action_id integer not null default 1, action_param varchar(250) not null default '', index (filter_type), @@ -241,6 +243,8 @@ create table ttrss_filters (id integer not null primary key auto_increment, foreign key (owner_uid) references ttrss_users(id) ON DELETE CASCADE, index (feed_id), foreign key (feed_id) references ttrss_feeds(id) ON DELETE CASCADE, + index (cat_id), + foreign key (cat_id) references ttrss_feed_categories(id) ON DELETE CASCADE, index (action_id), foreign key (action_id) references ttrss_filter_actions(id) ON DELETE CASCADE) ENGINE=InnoDB DEFAULT CHARSET=UTF8; @@ -255,7 +259,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 (86); +insert into ttrss_version values (87); create table ttrss_enclosures (id integer primary key auto_increment, content_url text not null, diff --git a/schema/ttrss_schema_pgsql.sql b/schema/ttrss_schema_pgsql.sql index d018d7f0b..917b48400 100644 --- a/schema/ttrss_schema_pgsql.sql +++ b/schema/ttrss_schema_pgsql.sql @@ -213,6 +213,8 @@ create table ttrss_filters (id serial not null primary key, filter_param varchar(250) not null default '', enabled boolean not null default true, inverse boolean not null default false, + cat_filter boolean not null default false, + cat_id integer references ttrss_feed_categories(id) on delete cascade default null, action_id integer not null default 1 references ttrss_filter_actions(id) on delete cascade, action_param varchar(250) not null default ''); @@ -226,7 +228,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 (86); +insert into ttrss_version values (87); create table ttrss_enclosures (id serial not null primary key, content_url text not null, diff --git a/schema/versions/mysql/87.sql b/schema/versions/mysql/87.sql new file mode 100644 index 000000000..b5acceaf7 --- /dev/null +++ b/schema/versions/mysql/87.sql @@ -0,0 +1,14 @@ +begin; + +alter table ttrss_filters add column cat_filter bool; +update ttrss_filters set cat_filter = true; +alter table ttrss_filters change cat_filter cat_filter bool not null; +alter table ttrss_filters alter column cat_filter set default false; + +alter table ttrss_filters add column cat_id integer; + +alter table ttrss_filters add FOREIGN KEY (cat_id) REFERENCES ttrss_feed_categories(id) ON DELETE CASCADE; + +update ttrss_version set schema_version = 87; + +commit; diff --git a/schema/versions/pgsql/87.sql b/schema/versions/pgsql/87.sql new file mode 100644 index 000000000..86d0c4f61 --- /dev/null +++ b/schema/versions/pgsql/87.sql @@ -0,0 +1,14 @@ +begin; + +alter table ttrss_filters add column cat_filter boolean; +update ttrss_filters set cat_filter = false; +alter table ttrss_filters alter column cat_filter set not null; +alter table ttrss_filters alter column cat_filter set default false; + +alter table ttrss_filters add column cat_id integer; + +alter table ttrss_filters add constraint "$5" FOREIGN KEY (cat_id) REFERENCES ttrss_feed_categories(id) ON DELETE CASCADE; + +update ttrss_version set schema_version = 87; + +commit; |