Add timestamps to block when they are inserted into the local database.
[cumulus.git] / schema.sql
index 114670c..096069b 100644 (file)
@@ -3,12 +3,20 @@
 --
 -- The index is stored in an SQLite3 database.  This is its schema.
 
--- Index of all blocks which have been stored in one snapshot, by checksum.
+-- Index of all blocks which have been stored in a snapshot, by checksum.
 create table block_index (
     blockid integer primary key,
     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);
+
+-- Index tracking which blocks are used by which snapshots.
+create table snapshot_contents (
+    blockid integer,
+    snapshot text
+);