Drop the obsolete snapshot_contents table from 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 -- List of snapshots which have been created.
7 create table snapshots (
8     snapshotid integer primary key,
9     name text not null,
10     scheme text,
11     timestamp real
12 );
13
14 -- List of segments which have been created.
15 create table segments (
16     segmentid integer primary key,
17     segment text unique not null,
18     path text,
19     checksum text,
20     size integer
21 );
22
23 -- Index of all blocks which have been stored, by checksum.
24 create table block_index (
25     blockid integer primary key,
26     segmentid integer not null,
27     object text not null,
28     checksum text,
29     size integer,
30     timestamp real,
31     expired integer
32 );
33 create index block_content_index on block_index(checksum);
34 create unique index block_name_index on block_index(segmentid, object);
35
36 -- Summary of segment utilization for each snapshots.
37 create table segments_used (
38     snapshotid integer not null,
39     segmentid integer not null,
40     utilization real
41 );