From 2362de6d9b4cff4e0ce8512861afbae0f3eee719 Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Sat, 13 Dec 2008 13:19:06 +0100 Subject: [PATCH] schema: add field for filter type-specific params; bump schema --- sanity_check.php | 2 +- schema/ttrss_schema_mysql.sql | 3 ++- schema/ttrss_schema_pgsql.sql | 3 ++- schema/versions/mysql/47.sql | 9 +++++++++ schema/versions/pgsql/47.sql | 12 ++++++++++++ 5 files changed, 26 insertions(+), 3 deletions(-) create mode 100644 schema/versions/mysql/47.sql create mode 100644 schema/versions/pgsql/47.sql diff --git a/sanity_check.php b/sanity_check.php index 16819fa6..5191f9c7 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 6934440a..00e52479 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 2efcaf7f..5d818208 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 00000000..a3afd94c --- /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 00000000..5dbd6e07 --- /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;