From 4fd52ba4b02b1d77cce6ebb921f9ec6d374fc4aa Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Sun, 20 Aug 2006 15:02:48 +0100 Subject: [PATCH] schema: add enabled field to ttrss_filters --- schema/ttrss_schema_mysql.sql | 1 + schema/ttrss_schema_pgsql.sql | 1 + schema/upgrade-1.1.7-1.2.2-mysql.sql | 5 +++++ schema/upgrade-1.1.7-1.2.2-pgsql.sql | 5 +++++ 4 files changed, 12 insertions(+) diff --git a/schema/ttrss_schema_mysql.sql b/schema/ttrss_schema_mysql.sql index 74ad87cf..b6bf1342 100644 --- a/schema/ttrss_schema_mysql.sql +++ b/schema/ttrss_schema_mysql.sql @@ -148,6 +148,7 @@ create table ttrss_filters (id integer not null primary key auto_increment, feed_id integer default null, filter_type integer not null, reg_exp varchar(250) not null, + enabled bool not null default true, action_id integer not null default 1, index (filter_type), foreign key (filter_type) references ttrss_filter_types(id) ON DELETE CASCADE, diff --git a/schema/ttrss_schema_pgsql.sql b/schema/ttrss_schema_pgsql.sql index 3e7ce8b5..81c865af 100644 --- a/schema/ttrss_schema_pgsql.sql +++ b/schema/ttrss_schema_pgsql.sql @@ -142,6 +142,7 @@ create table ttrss_filters (id serial not null primary key, feed_id integer references ttrss_feeds(id) on delete cascade default null, filter_type integer not null references ttrss_filter_types(id), reg_exp varchar(250) not null, + enabled boolean not null default true, action_id integer not null default 1 references ttrss_filter_actions(id) on delete cascade); create table ttrss_labels (id serial not null primary key, diff --git a/schema/upgrade-1.1.7-1.2.2-mysql.sql b/schema/upgrade-1.1.7-1.2.2-mysql.sql index a82a0626..546adc2d 100644 --- a/schema/upgrade-1.1.7-1.2.2-mysql.sql +++ b/schema/upgrade-1.1.7-1.2.2-mysql.sql @@ -12,6 +12,11 @@ alter table ttrss_users add column last_digest_sent datetime; update ttrss_users set last_digest_sent = false; alter table ttrss_users alter column last_digest_sent set default null; +alter table ttrss_filters add column enabled bool; +update ttrss_filters set enabled = true; +alter table ttrss_filters change enabled enabled bool not null; +alter table ttrss_filters alter column enabled set default true; + insert into ttrss_prefs (pref_name,type_id,def_value,short_desc,section_id) values('MARK_UNREAD_ON_UPDATE', 1, 'false', 'Set articles as unread on update',3); insert into ttrss_prefs (pref_name,type_id,def_value,short_desc,section_id) values('REVERSE_HEADLINES', 1, 'false', 'Reverse headline order (oldest first)',2); diff --git a/schema/upgrade-1.1.7-1.2.2-pgsql.sql b/schema/upgrade-1.1.7-1.2.2-pgsql.sql index b47d89bc..9624403a 100644 --- a/schema/upgrade-1.1.7-1.2.2-pgsql.sql +++ b/schema/upgrade-1.1.7-1.2.2-pgsql.sql @@ -14,6 +14,11 @@ alter table ttrss_users add column last_digest_sent timestamp; update ttrss_users set last_digest_sent = NULL; alter table ttrss_users alter column last_digest_sent set default NULL; +alter table ttrss_filters add column enabled boolean; +update ttrss_filters set enabled = true; +alter table ttrss_filters alter column enabled set not null; +alter table ttrss_filters alter column enabled set default true; + insert into ttrss_prefs (pref_name,type_id,def_value,short_desc,section_id) values('MARK_UNREAD_ON_UPDATE', 1, 'false', 'Set articles as unread on update',3); insert into ttrss_prefs (pref_name,type_id,def_value,short_desc,section_id) values('REVERSE_HEADLINES', 1, 'false', 'Reverse headline order (oldest first)',2); -- 2.39.5