From 534e35d886de4eb7b6022c0ecb4a804475c820ea Mon Sep 17 00:00:00 2001 From: Michael Vrable Date: Wed, 16 May 2007 14:50:01 -0700 Subject: [PATCH] Add timestamps to block when they are inserted into the local database. --- localdb.cc | 4 ++-- schema.sql | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) 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); -- 2.20.1