ttrss_filters: add action_param field, bump schema version

master
Andrew Dolgov 18 years ago
parent 3db880c627
commit 9ebaec057c

@ -16,7 +16,7 @@
$op = $_REQUEST["op"];
define('SCHEMA_VERSION', 11);
define('SCHEMA_VERSION', 12);
require_once "sanity_check.php";
require_once "config.php";

@ -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;

@ -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);

@ -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;

@ -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;
Loading…
Cancel
Save