diff --git a/sanity_check.php b/sanity_check.php index 16819fa6a..5191f9c7e 100644 --- a/sanity_check.php +++ b/sanity_check.php @@ -2,7 +2,7 @@ require_once "functions.php"; define('EXPECTED_CONFIG_VERSION', 17); - define('SCHEMA_VERSION', 46); + define('SCHEMA_VERSION', 47); if (!file_exists("config.php")) { print __("Fatal Error: You forgot to copy diff --git a/schema/ttrss_schema_mysql.sql b/schema/ttrss_schema_mysql.sql index 6934440a6..00e52479a 100644 --- a/schema/ttrss_schema_mysql.sql +++ b/schema/ttrss_schema_mysql.sql @@ -184,6 +184,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, + filter_param varchar(250) not null default '', inverse bool not null default false, enabled bool not null default true, action_id integer not null default 1, @@ -221,7 +222,7 @@ create table ttrss_tags (id integer primary key auto_increment, create table ttrss_version (schema_version int not null) TYPE=InnoDB; -insert into ttrss_version values (46); +insert into ttrss_version values (47); create table ttrss_enclosures (id serial not null primary key, content_url text not null, diff --git a/schema/ttrss_schema_pgsql.sql b/schema/ttrss_schema_pgsql.sql index 2efcaf7f0..5d818208d 100644 --- a/schema/ttrss_schema_pgsql.sql +++ b/schema/ttrss_schema_pgsql.sql @@ -171,6 +171,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, + filter_param varchar(250) not null default '', enabled boolean not null default true, inverse boolean not null default false, action_id integer not null default 1 references ttrss_filter_actions(id) on delete cascade, @@ -198,7 +199,7 @@ create index ttrss_tags_owner_uid_index on ttrss_tags(owner_uid); create table ttrss_version (schema_version int not null); -insert into ttrss_version values (46); +insert into ttrss_version values (47); create table ttrss_enclosures (id serial not null primary key, content_url text not null, diff --git a/schema/versions/mysql/47.sql b/schema/versions/mysql/47.sql new file mode 100644 index 000000000..a3afd94c5 --- /dev/null +++ b/schema/versions/mysql/47.sql @@ -0,0 +1,9 @@ +alter table ttrss_filters add column filter_param varchar(200); + +update ttrss_filters set filter_param = ''; + +alter table ttrss_filters change filter_param filter_param varchar(200) not null; +alter table ttrss_filters alter column filter_param set default ''; + +update ttrss_version set schema_version = 47; + diff --git a/schema/versions/pgsql/47.sql b/schema/versions/pgsql/47.sql new file mode 100644 index 000000000..5dbd6e07e --- /dev/null +++ b/schema/versions/pgsql/47.sql @@ -0,0 +1,12 @@ +begin; + +alter table ttrss_filters add column filter_param varchar(200); + +update ttrss_filters set filter_param = ''; + +alter table ttrss_filters alter column filter_param set not null; +alter table ttrss_filters alter column filter_param set default ''; + +update ttrss_version set schema_version = 47; + +commit;