Add timestamps to block when they are inserted into the local database.
[cumulus.git] / schema.sql
1 -- We maintain a local index of data blocks that have been previously stored
2 -- for constructing incremental snapshots.
3 --
4 -- The index is stored in an SQLite3 database.  This is its schema.
5
6 -- Index of all blocks which have been stored in a snapshot, by checksum.
7 create table block_index (
8     blockid integer primary key,
9     segment text,
10     object text,
11     checksum text,
12     size integer,
13     timestamp real
14 );
15 create index block_content_index on block_index(checksum);
16 create index block_name_index on block_index(segment, object);
17
18 -- Index tracking which blocks are used by which snapshots.
19 create table snapshot_contents (
20     blockid integer,
21     snapshot text
22 );