From 32be4b10c33a31d0e44e2062c37bede01c994f22 Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Sun, 20 Aug 2006 11:54:53 +0100 Subject: [PATCH] add fields for daily email digest to ttrss_users --- schema/ttrss_schema_mysql.sql | 2 ++ schema/ttrss_schema_pgsql.sql | 2 ++ schema/upgrade-1.1.7-1.2.2-mysql.sql | 11 +++++++++-- schema/upgrade-1.1.7-1.2.2-pgsql.sql | 11 +++++++++-- 4 files changed, 22 insertions(+), 4 deletions(-) diff --git a/schema/ttrss_schema_mysql.sql b/schema/ttrss_schema_mysql.sql index 7cc4cac0..74ad87cf 100644 --- a/schema/ttrss_schema_mysql.sql +++ b/schema/ttrss_schema_mysql.sql @@ -33,6 +33,8 @@ create table ttrss_users (id integer primary key not null auto_increment, access_level integer not null default 0, theme_id integer default null, email varchar(250) not null default '', + email_digest bool not null default false, + last_digest_sent datetime default null, index (theme_id), foreign key (theme_id) references ttrss_themes(id)) TYPE=InnoDB; diff --git a/schema/ttrss_schema_pgsql.sql b/schema/ttrss_schema_pgsql.sql index 47817c77..3e7ce8b5 100644 --- a/schema/ttrss_schema_pgsql.sql +++ b/schema/ttrss_schema_pgsql.sql @@ -32,6 +32,8 @@ create table ttrss_users (id serial not null primary key, last_login timestamp default null, access_level integer not null default 0, email varchar(250) not null default '', + email_digest boolean not null default false, + last_digest_sent timestamp default null, theme_id integer references ttrss_themes(id) default null); insert into ttrss_users (login,pwd_hash,access_level) values ('admin', diff --git a/schema/upgrade-1.1.7-1.2.2-mysql.sql b/schema/upgrade-1.1.7-1.2.2-mysql.sql index c3f253f8..a82a0626 100644 --- a/schema/upgrade-1.1.7-1.2.2-mysql.sql +++ b/schema/upgrade-1.1.7-1.2.2-mysql.sql @@ -1,10 +1,17 @@ alter table ttrss_feeds add column hidden bool; - update ttrss_feeds set hidden = false; - alter table ttrss_feeds change hidden hidden bool not null; alter table ttrss_feeds alter column hidden set default false; +alter table ttrss_users add column email_digest bool; +update ttrss_users set email_digest = false; +alter table ttrss_users change email_digest email_digest bool not null; +alter table ttrss_users alter column email_digest set default false; + +alter table ttrss_users add column last_digest_sent datetime; +update ttrss_users set last_digest_sent = false; +alter table ttrss_users alter column last_digest_sent set default null; + insert into ttrss_prefs (pref_name,type_id,def_value,short_desc,section_id) values('MARK_UNREAD_ON_UPDATE', 1, 'false', 'Set articles as unread on update',3); insert into ttrss_prefs (pref_name,type_id,def_value,short_desc,section_id) values('REVERSE_HEADLINES', 1, 'false', 'Reverse headline order (oldest first)',2); diff --git a/schema/upgrade-1.1.7-1.2.2-pgsql.sql b/schema/upgrade-1.1.7-1.2.2-pgsql.sql index f651b6a7..b47d89bc 100644 --- a/schema/upgrade-1.1.7-1.2.2-pgsql.sql +++ b/schema/upgrade-1.1.7-1.2.2-pgsql.sql @@ -1,12 +1,19 @@ begin; alter table ttrss_feeds add column hidden boolean; - update ttrss_feeds set hidden = false; - alter table ttrss_feeds alter column hidden set not null; alter table ttrss_feeds alter column hidden set default false; +alter table ttrss_users add column email_digest boolean; +update ttrss_users set email_digest = false; +alter table ttrss_users alter column email_digest set not null; +alter table ttrss_users alter column email_digest set default false; + +alter table ttrss_users add column last_digest_sent timestamp; +update ttrss_users set last_digest_sent = NULL; +alter table ttrss_users alter column last_digest_sent set default NULL; + insert into ttrss_prefs (pref_name,type_id,def_value,short_desc,section_id) values('MARK_UNREAD_ON_UPDATE', 1, 'false', 'Set articles as unread on update',3); insert into ttrss_prefs (pref_name,type_id,def_value,short_desc,section_id) values('REVERSE_HEADLINES', 1, 'false', 'Reverse headline order (oldest first)',2);