diff --git a/schema/ttrss_schema_mysql.sql b/schema/ttrss_schema_mysql.sql index 93a2aa29..d63a9d57 100644 --- a/schema/ttrss_schema_mysql.sql +++ b/schema/ttrss_schema_mysql.sql @@ -7,6 +7,7 @@ create table ttrss_feeds (id integer not null auto_increment primary key, feed_url varchar(250) unique not null, icon_url varchar(250) not null default '', update_interval integer not null default 0, + purge_interval integer not null default 0, last_updated datetime default '', last_error text not null default '', site_url varchar(250) not null default '') TYPE=InnoDB; @@ -88,6 +89,6 @@ drop table ttrss_version; create table ttrss_version (schema_version int not null) TYPE=InnoDB; -insert into ttrss_version values (1); +insert into ttrss_version values (2); diff --git a/schema/ttrss_schema_pgsql.sql b/schema/ttrss_schema_pgsql.sql index 3a20588e..2a63243a 100644 --- a/schema/ttrss_schema_pgsql.sql +++ b/schema/ttrss_schema_pgsql.sql @@ -7,6 +7,7 @@ create table ttrss_feeds (id serial not null primary key, feed_url varchar(250) unique not null, icon_url varchar(250) not null default '', update_interval integer not null default 0, + purge_interval integer not null default 0, last_updated timestamp default null, last_error text not null default '', site_url varchar(250) not null default ''); @@ -83,5 +84,5 @@ drop table ttrss_version; create table ttrss_version (schema_version int not null); -insert into ttrss_version values (1); +insert into ttrss_version values (2); diff --git a/schema/upgrade-1.0.7-1.0.8-pgsql.sql b/schema/upgrade-1.0.7-1.0.8-pgsql.sql new file mode 100644 index 00000000..abae1c68 --- /dev/null +++ b/schema/upgrade-1.0.7-1.0.8-pgsql.sql @@ -0,0 +1,12 @@ +begin; + +alter table ttrss_feeds add column purge_interval integer; + +update ttrss_feeds set purge_interval = 0; + +alter table ttrss_feeds alter column purge_interval set not null; +alter table ttrss_feeds alter column purge_interval set default 0; + +update ttrss_version set schema_version = 2; + +commit;