schema: add field for filter type-specific params; bump schema
This commit is contained in:
parent
d0da85c27c
commit
2362de6d9b
|
@ -2,7 +2,7 @@
|
||||||
require_once "functions.php";
|
require_once "functions.php";
|
||||||
|
|
||||||
define('EXPECTED_CONFIG_VERSION', 17);
|
define('EXPECTED_CONFIG_VERSION', 17);
|
||||||
define('SCHEMA_VERSION', 46);
|
define('SCHEMA_VERSION', 47);
|
||||||
|
|
||||||
if (!file_exists("config.php")) {
|
if (!file_exists("config.php")) {
|
||||||
print __("<b>Fatal Error</b>: You forgot to copy
|
print __("<b>Fatal Error</b>: You forgot to copy
|
||||||
|
|
|
@ -184,6 +184,7 @@ create table ttrss_filters (id integer not null primary key auto_increment,
|
||||||
feed_id integer default null,
|
feed_id integer default null,
|
||||||
filter_type integer not null,
|
filter_type integer not null,
|
||||||
reg_exp varchar(250) not null,
|
reg_exp varchar(250) not null,
|
||||||
|
filter_param varchar(250) not null default '',
|
||||||
inverse bool not null default false,
|
inverse bool not null default false,
|
||||||
enabled bool not null default true,
|
enabled bool not null default true,
|
||||||
action_id integer not null default 1,
|
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;
|
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,
|
create table ttrss_enclosures (id serial not null primary key,
|
||||||
content_url text not null,
|
content_url text not null,
|
||||||
|
|
|
@ -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,
|
feed_id integer references ttrss_feeds(id) on delete cascade default null,
|
||||||
filter_type integer not null references ttrss_filter_types(id),
|
filter_type integer not null references ttrss_filter_types(id),
|
||||||
reg_exp varchar(250) not null,
|
reg_exp varchar(250) not null,
|
||||||
|
filter_param varchar(250) not null default '',
|
||||||
enabled boolean not null default true,
|
enabled boolean not null default true,
|
||||||
inverse boolean not null default false,
|
inverse boolean not null default false,
|
||||||
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,
|
||||||
|
@ -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);
|
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,
|
create table ttrss_enclosures (id serial not null primary key,
|
||||||
content_url text not null,
|
content_url text not null,
|
||||||
|
|
|
@ -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;
|
||||||
|
|
|
@ -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;
|
Loading…
Reference in New Issue