Skip to content

Commit

Permalink
Update the schema to match that of Trillian repo. The map specific (#528
Browse files Browse the repository at this point in the history
  • Loading branch information
vaikas authored Dec 11, 2021
1 parent 2978afb commit 130ff80
Showing 1 changed file with 0 additions and 31 deletions.
31 changes: 0 additions & 31 deletions scripts/storage.sql
Original file line number Diff line number Diff line change
Expand Up @@ -151,34 +151,3 @@ CREATE TABLE IF NOT EXISTS Unsequenced(
QueueID VARBINARY(32) DEFAULT NULL UNIQUE,
PRIMARY KEY (TreeId, Bucket, QueueTimestampNanos, LeafIdentityHash)
);


-- ---------------------------------------------
-- Map specific stuff here
-- ---------------------------------------------

CREATE TABLE IF NOT EXISTS MapLeaf(
TreeId BIGINT NOT NULL,
KeyHash VARBINARY(255) NOT NULL,
-- MapRevision is stored negated to invert ordering in the primary key index
-- st. more recent revisions come first.
MapRevision BIGINT NOT NULL,
LeafValue LONGBLOB NOT NULL,
PRIMARY KEY(TreeId, KeyHash, MapRevision),
FOREIGN KEY(TreeId) REFERENCES Trees(TreeId) ON DELETE CASCADE
);


CREATE TABLE IF NOT EXISTS MapHead(
TreeId BIGINT NOT NULL,
MapHeadTimestamp BIGINT,
RootHash VARBINARY(255) NOT NULL,
MapRevision BIGINT,
RootSignature VARBINARY(1024) NOT NULL,
MapperData MEDIUMBLOB,
PRIMARY KEY(TreeId, MapHeadTimestamp),
FOREIGN KEY(TreeId) REFERENCES Trees(TreeId) ON DELETE CASCADE
);

CREATE UNIQUE INDEX MapHeadRevisionIdx
ON MapHead(TreeId, MapRevision);

0 comments on commit 130ff80

Please # to comment.