Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update the schema to match that of Trillian repo. #528

Merged
merged 1 commit into from
Dec 11, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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);