From 9ebaec057c6c9e1644eb7673ddb3f709b9874bb8 Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Fri, 8 Dec 2006 07:31:49 +0100 Subject: [PATCH] ttrss_filters: add action_param field, bump schema version --- backend.php | 2 +- schema/ttrss_schema_mysql.sql | 3 ++- schema/ttrss_schema_pgsql.sql | 5 +++-- schema/upgrade-1.2.4-1.2.6-mysql.sql | 9 +++++++++ schema/upgrade-1.2.4-1.2.6-pgsql.sql | 12 ++++++++++++ 5 files changed, 27 insertions(+), 4 deletions(-) create mode 100644 schema/upgrade-1.2.4-1.2.6-mysql.sql create mode 100644 schema/upgrade-1.2.4-1.2.6-pgsql.sql diff --git a/backend.php b/backend.php index fd7ced8a..3d533896 100644 --- a/backend.php +++ b/backend.php @@ -16,7 +16,7 @@ $op = $_REQUEST["op"]; - define('SCHEMA_VERSION', 11); + define('SCHEMA_VERSION', 12); require_once "sanity_check.php"; require_once "config.php"; diff --git a/schema/ttrss_schema_mysql.sql b/schema/ttrss_schema_mysql.sql index 19f38eaa..384bd1e8 100644 --- a/schema/ttrss_schema_mysql.sql +++ b/schema/ttrss_schema_mysql.sql @@ -153,6 +153,7 @@ create table ttrss_filters (id integer not null primary key auto_increment, reg_exp varchar(250) not null, enabled bool not null default true, action_id integer not null default 1, + action_param varchar(200) not null default '', index (filter_type), foreign key (filter_type) references ttrss_filter_types(id) ON DELETE CASCADE, index (owner_uid), @@ -186,7 +187,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 (11); +insert into ttrss_version values (12); create table ttrss_prefs_types (id integer not null primary key, type_name varchar(100) not null) TYPE=InnoDB; diff --git a/schema/ttrss_schema_pgsql.sql b/schema/ttrss_schema_pgsql.sql index 0bd4caad..b0cd36d8 100644 --- a/schema/ttrss_schema_pgsql.sql +++ b/schema/ttrss_schema_pgsql.sql @@ -146,7 +146,8 @@ create table ttrss_filters (id serial not null primary key, 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); + action_id integer not null default 1 references ttrss_filter_actions(id) on delete cascade, + action_param varchar(200) not null default ''); create table ttrss_labels (id serial not null primary key, owner_uid integer not null references ttrss_users(id) on delete cascade, @@ -170,7 +171,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 (11); +insert into ttrss_version values (12); create table ttrss_prefs_types (id integer not null primary key, type_name varchar(100) not null); diff --git a/schema/upgrade-1.2.4-1.2.6-mysql.sql b/schema/upgrade-1.2.4-1.2.6-mysql.sql new file mode 100644 index 00000000..2b100d17 --- /dev/null +++ b/schema/upgrade-1.2.4-1.2.6-mysql.sql @@ -0,0 +1,9 @@ +alter table ttrss_filters add column action_param varchar(200); + +update ttrss_filters set action_param = ''; + +alter table ttrss_filters change action_param action_param varchar(200) not null; +alter table ttrss_filters alter column action_param set default ''; + +update ttrss_version set schema_version = 12; + diff --git a/schema/upgrade-1.2.4-1.2.6-pgsql.sql b/schema/upgrade-1.2.4-1.2.6-pgsql.sql new file mode 100644 index 00000000..07ded63c --- /dev/null +++ b/schema/upgrade-1.2.4-1.2.6-pgsql.sql @@ -0,0 +1,12 @@ +begin; + +alter table ttrss_filters add column action_param varchar(200); + +update ttrss_filters set action_param = ''; + +alter table ttrss_filters alter column action_param set not null; +alter table ttrss_filters alter column action_param set default ''; + +update ttrss_version set schema_version = 12; + +commit;