Slight tweaks to the local database to improve cleaning procedures.
[cumulus.git] / schema.sql
index 3cf175b..f406d91 100644 (file)
@@ -19,7 +19,8 @@ create table segments (
     path text,
     checksum text,
     mtime real,
-    size integer
+    size integer,
+    expire_time integer         -- snapshotid of latest snapshot when expired
 );
 
 -- Index of all blocks which have been stored, by checksum.
@@ -41,6 +42,8 @@ create table segments_used (
     segmentid integer not null,
     utilization real
 );
+create unique index segments_used_index
+    on segments_used(snapshotid, segmentid);
 
 -- Overall estimate of segment utilization, for all snapshots combined.
 create view segment_info as