+-- Versioning information, describing the revision for which the table schema
+-- was set up.
+create table schema_version(
+ version text, -- Program version, dotted decimal string
+ major integer, -- Major version number
+ minor integer -- Minor version number
+);
+insert into schema_version values ('0.11', 0, 11);
+
+-- List of snapshots which have been created and which we are still tracking.
+-- There may be more snapshots than this actually stored at the remote server,
+-- but the reverse should not ever be true: Cumulus may depend on data stored
+-- in these snapshots when writing a new snapshot.
+create table snapshots (
+ snapshotid integer primary key,
+ name text not null,
+ scheme text not null,
+ timestamp real,
+ intent real -- TODO: deprecated, should be removed
+);
+
+-- List of segments which have been created.
+create table segments (
+ segmentid integer primary key,
+ segment text unique not null,
+ mtime real, -- timestamp when segment was created
+ path text,
+ checksum text,
+ data_size integer, -- sum of bytes in all objects in the segment
+ disk_size integer, -- size of segment on disk, after compression
+ type text
+);
+
+-- Index of all data blocks in stored segments. This is indexed by content
+-- hash to allow for coarse block-level data deduplication.