Add timestamps to block when they are inserted into the local database.
authorMichael Vrable <mvrable@cs.ucsd.edu>
Wed, 16 May 2007 21:50:01 +0000 (14:50 -0700)
committerMichael Vrable <mvrable@turin.ucsd.edu>
Wed, 16 May 2007 21:50:01 +0000 (14:50 -0700)
localdb.cc
schema.sql

index 27fec5a..9bd33d9 100644 (file)
@@ -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);
index 8518c4f..096069b 100644 (file)
@@ -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);