X-Git-Url: http://git.vrable.net/?a=blobdiff_plain;f=schema.sql;h=d225ec1f1c0cc0be002fc31ca9a74bf8b6c1c9a2;hb=cac644d993d130efd8d29539de6557b18c9b737e;hp=8518c4fa7fc2922ae9575b4a50c19a77d3620be6;hpb=da87780779a2f165503d019ee0b59d10e5d31ec8;p=cumulus.git diff --git a/schema.sql b/schema.sql index 8518c4f..d225ec1 100644 --- a/schema.sql +++ b/schema.sql @@ -3,19 +3,36 @@ -- -- The index is stored in an SQLite3 database. This is its schema. +-- List of snapshots which have been created. +create table snapshots ( + snapshotid integer primary key, + name text not null, + timestamp real +); + +-- List of segments which have been created. +create table segments ( + segmentid integer primary key, + segment text unique not null +); + -- 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, + segmentid integer not null, + object text not null, checksum text, - size integer + size integer, + timestamp real, + expired integer ); create index block_content_index on block_index(checksum); -create index block_name_index on block_index(segment, object); +create unique index block_name_index on block_index(segmentid, object); -- Index tracking which blocks are used by which snapshots. create table snapshot_contents ( blockid integer, - snapshot text + snapshotid integer ); +create unique index snapshot_contents_unique + on snapshot_contents(blockid, snapshotid);