forked from Consensys/tessera
-
Notifications
You must be signed in to change notification settings - Fork 0
/
h2-ddl.sql
6 lines (6 loc) · 1.06 KB
/
h2-ddl.sql
1
2
3
4
5
6
CREATE TABLE ENCRYPTED_TRANSACTION (ENCODED_PAYLOAD LONGVARBINARY NOT NULL, PAYLOAD_CODEC VARCHAR(50), TIMESTAMP BIGINT, HASH LONGVARBINARY NOT NULL, PRIMARY KEY (HASH));
CREATE TABLE ENCRYPTED_RAW_TRANSACTION (ENCRYPTED_KEY LONGVARBINARY NOT NULL, ENCRYPTED_PAYLOAD LONGVARBINARY NOT NULL, NONCE LONGVARBINARY NOT NULL, SENDER LONGVARBINARY NOT NULL, TIMESTAMP BIGINT, HASH LONGVARBINARY NOT NULL, PRIMARY KEY (HASH));
CREATE TABLE PRIVACY_GROUP(ID LONGVARBINARY NOT NULL, LOOKUP_ID LONGVARBINARY NOT NULL, DATA LONGVARBINARY NOT NULL, TIMESTAMP BIGINT, PRIMARY KEY (ID));
CREATE TABLE ST_TRANSACTION(ID BIGINT NOT NULL PRIMARY KEY, PAYLOAD_CODEC VARCHAR(50), HASH VARCHAR NOT NULL, PAYLOAD LONGVARBINARY, PRIVACY_MODE INTEGER, TIMESTAMP BIGINT, VALIDATION_STAGE BIGINT);
CREATE TABLE ST_AFFECTED_TRANSACTION(ID BIGINT NOT NULL PRIMARY KEY, AFFECTED_HASH VARCHAR NOT NULL, TXN_ID BIGINT NOT NULL, CONSTRAINT FK_ST_AFFECTED_TRANSACTION_TXN_ID FOREIGN KEY (TXN_ID) REFERENCES ST_TRANSACTION (ID));
CREATE INDEX IF NOT EXISTS ST_TRANSACTION_VALSTG ON ST_TRANSACTION(VALIDATION_STAGE);