diff --git a/sanity_check.php b/sanity_check.php index 3735d6c4..167fef68 100644 --- a/sanity_check.php +++ b/sanity_check.php @@ -2,7 +2,7 @@ require_once "functions.php"; define('EXPECTED_CONFIG_VERSION', 15); - define('SCHEMA_VERSION', 35); + define('SCHEMA_VERSION', 36); 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 f2daa69f..819ee216 100644 --- a/schema/ttrss_schema_mysql.sql +++ b/schema/ttrss_schema_mysql.sql @@ -115,6 +115,7 @@ create table ttrss_user_entries ( marked bool not null default 0, published bool not null default 0, last_read datetime, + score int not null default 0, unread bool not null default 1, index (ref_id), foreign key (ref_id) references ttrss_entries(id) ON DELETE CASCADE, @@ -205,7 +206,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 (35); +insert into ttrss_version values (36); 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 c35781a6..0bfe4d8b 100644 --- a/schema/ttrss_schema_pgsql.sql +++ b/schema/ttrss_schema_pgsql.sql @@ -107,6 +107,7 @@ create table ttrss_user_entries ( marked boolean not null default false, published boolean not null default false, last_read timestamp, + score int not null default 0, unread boolean not null default true); -- create index ttrss_user_entries_feed_id_index on ttrss_user_entries(feed_id); @@ -185,7 +186,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 (35); +insert into ttrss_version values (36); create table ttrss_enclosures (id serial not null primary key, content_url text not null, diff --git a/schema/versions/mysql/36.sql b/schema/versions/mysql/36.sql new file mode 100644 index 00000000..09bea8e1 --- /dev/null +++ b/schema/versions/mysql/36.sql @@ -0,0 +1,6 @@ +alter table ttrss_user_entries add column score integer; +update ttrss_user_entries set score = 0; +alter table ttrss_user_entries change score score integer not null; +alter table ttrss_user_entries alter column score set default 0; + +update ttrss_version set schema_version = 36; diff --git a/schema/versions/pgsql/36.sql b/schema/versions/pgsql/36.sql new file mode 100644 index 00000000..6b61cadf --- /dev/null +++ b/schema/versions/pgsql/36.sql @@ -0,0 +1,6 @@ +alter table ttrss_user_entries add column score int; +update ttrss_user_entries set score = 0; +alter table ttrss_user_entries alter column score set not null; +alter table ttrss_user_entries alter column score set default 0; + +update ttrss_version set schema_version = 36;