schema: add created field to ttrss_users

This commit is contained in:
Andrew Dolgov 2007-11-16 06:11:59 +01:00
parent e553f0a6d8
commit 54a3d3cf51
6 changed files with 21 additions and 7 deletions

View file

@ -326,7 +326,8 @@
SUBSTRING(last_login,1,16) AS last_login, SUBSTRING(last_login,1,16) AS last_login,
access_level, access_level,
(SELECT COUNT(int_id) FROM ttrss_user_entries (SELECT COUNT(int_id) FROM ttrss_user_entries
WHERE owner_uid = id) AS stored_articles WHERE owner_uid = id) AS stored_articles,
SUBSTRING(created,1,16) AS created
FROM ttrss_users FROM ttrss_users
WHERE id = '$uid'"); WHERE id = '$uid'");
@ -345,20 +346,25 @@
$last_login = date(get_pref($link, 'LONG_DATE_FORMAT'), $last_login = date(get_pref($link, 'LONG_DATE_FORMAT'),
strtotime(db_fetch_result($result, 0, "last_login"))); strtotime(db_fetch_result($result, 0, "last_login")));
$created = date(get_pref($link, 'LONG_DATE_FORMAT'),
strtotime(db_fetch_result($result, 0, "created")));
$access_level = db_fetch_result($result, 0, "access_level"); $access_level = db_fetch_result($result, 0, "access_level");
$stored_articles = db_fetch_result($result, 0, "stored_articles"); $stored_articles = db_fetch_result($result, 0, "stored_articles");
# print "<tr><td>Username</td><td>$login</td></tr>"; # print "<tr><td>Username</td><td>$login</td></tr>";
# print "<tr><td>Access level</td><td>$access_level</td></tr>"; # print "<tr><td>Access level</td><td>$access_level</td></tr>";
print "<tr><td>Last logged in</td><td>$last_login</td></tr>"; print "<tr><td>".__('Registered')."</td><td>$created</td></tr>";
print "<tr><td>Stored articles</td><td>$stored_articles</td></tr>"; print "<tr><td>".__('Last logged in')."</td><td>$last_login</td></tr>";
print "<tr><td>".__('Stored articles')."</td><td>$stored_articles</td></tr>";
$result = db_query($link, "SELECT COUNT(id) as num_feeds FROM ttrss_feeds $result = db_query($link, "SELECT COUNT(id) as num_feeds FROM ttrss_feeds
WHERE owner_uid = '$uid'"); WHERE owner_uid = '$uid'");
$num_feeds = db_fetch_result($result, 0, "num_feeds"); $num_feeds = db_fetch_result($result, 0, "num_feeds");
print "<tr><td>Subscribed feeds count</td><td>$num_feeds</td></tr>"; print "<tr><td>".__('Subscribed feeds count')."</td><td>$num_feeds</td></tr>";
/* $result = db_query($link, "SELECT /* $result = db_query($link, "SELECT
SUM(LENGTH(content)+LENGTH(title)+LENGTH(link)+LENGTH(guid)) AS db_size SUM(LENGTH(content)+LENGTH(title)+LENGTH(link)+LENGTH(guid)) AS db_size
@ -371,7 +377,7 @@
print "</table>"; print "</table>";
print "<h1>Subscribed feeds</h1>"; print "<h1>".__('Subscribed feeds')."</h1>";
$result = db_query($link, "SELECT id,title,site_url FROM ttrss_feeds $result = db_query($link, "SELECT id,title,site_url FROM ttrss_feeds
WHERE owner_uid = '$uid' ORDER BY title"); WHERE owner_uid = '$uid' ORDER BY title");

View file

@ -109,8 +109,8 @@
if (db_num_rows($result) == 0) { if (db_num_rows($result) == 0) {
db_query($link, "INSERT INTO ttrss_users db_query($link, "INSERT INTO ttrss_users
(login,pwd_hash,access_level,last_login) (login,pwd_hash,access_level,last_login,created)
VALUES ('$login', '$pwd_hash', 0, NOW())"); VALUES ('$login', '$pwd_hash', 0, null, NOW())");
$result = db_query($link, "SELECT id FROM ttrss_users WHERE $result = db_query($link, "SELECT id FROM ttrss_users WHERE

View file

@ -41,6 +41,7 @@ create table ttrss_users (id integer primary key not null auto_increment,
email varchar(250) not null default '', email varchar(250) not null default '',
email_digest bool not null default false, email_digest bool not null default false,
last_digest_sent datetime default null, last_digest_sent datetime default null,
created datetime default null,
index (theme_id), index (theme_id),
foreign key (theme_id) references ttrss_themes(id)) TYPE=InnoDB; foreign key (theme_id) references ttrss_themes(id)) TYPE=InnoDB;

View file

@ -37,6 +37,7 @@ create table ttrss_users (id serial not null primary key,
email varchar(250) not null default '', email varchar(250) not null default '',
email_digest boolean not null default false, email_digest boolean not null default false,
last_digest_sent timestamp default null, last_digest_sent timestamp default null,
created timestamp default null,
theme_id integer references ttrss_themes(id) default null); theme_id integer references ttrss_themes(id) default null);
insert into ttrss_users (login,pwd_hash,access_level) values ('admin', insert into ttrss_users (login,pwd_hash,access_level) values ('admin',

View file

@ -1,3 +1,6 @@
insert into ttrss_prefs (pref_name,type_id,def_value,short_desc,section_id) values('PURGE_UNREAD_ARTICLES', 1, 'true', 'Purge unread articles',3); insert into ttrss_prefs (pref_name,type_id,def_value,short_desc,section_id) values('PURGE_UNREAD_ARTICLES', 1, 'true', 'Purge unread articles',3);
alter table ttrss_users add column created datetime;
alter table ttrss_users alter column created set default null;
update ttrss_version set schema_version = 26; update ttrss_version set schema_version = 26;

View file

@ -1,3 +1,6 @@
insert into ttrss_prefs (pref_name,type_id,def_value,short_desc,section_id) values('PURGE_UNREAD_ARTICLES', 1, 'true', 'Purge unread articles',3); insert into ttrss_prefs (pref_name,type_id,def_value,short_desc,section_id) values('PURGE_UNREAD_ARTICLES', 1, 'true', 'Purge unread articles',3);
alter table ttrss_users add column created timestamp;
alter table ttrss_users alter column created set default null;
update ttrss_version set schema_version = 26; update ttrss_version set schema_version = 26;