From: Michael Vrable Date: Wed, 16 May 2007 21:50:01 +0000 (-0700) Subject: Add timestamps to block when they are inserted into the local database. X-Git-Url: https://git.vrable.net/?a=commitdiff_plain;h=534e35d886de4eb7b6022c0ecb4a804475c820ea;p=cumulus.git Add timestamps to block when they are inserted into the local database. --- diff --git a/localdb.cc b/localdb.cc index 27fec5a..9bd33d9 100644 --- a/localdb.cc +++ b/localdb.cc @@ -59,8 +59,8 @@ void LocalDb::StoreObject(const ObjectReference& ref, int rc; sqlite3_stmt *stmt; static const char s[] = - "insert into block_index(segment, object, checksum, size) " - "values (?, ?, ?, ?)"; + "insert into block_index(segment, object, checksum, size, timestamp) " + "values (?, ?, ?, ?, julianday('now'))"; const char *tail; rc = sqlite3_prepare_v2(db, s, strlen(s), &stmt, &tail); diff --git a/schema.sql b/schema.sql index 8518c4f..096069b 100644 --- a/schema.sql +++ b/schema.sql @@ -9,7 +9,8 @@ create table block_index ( segment text, object text, checksum text, - size integer + size integer, + timestamp real ); create index block_content_index on block_index(checksum); create index block_name_index on block_index(segment, object);