summary refs log tree commit diff
path: root/synapse/storage/schema/signatures.sql
diff options
context:
space:
mode:
authorMark Haines <mark.haines@matrix.org>2014-10-16 23:25:12 +0100
committerMark Haines <mark.haines@matrix.org>2014-10-16 23:25:12 +0100
commitbb04447c44036ebf3ae5dde7a4cc7a7909d50ef6 (patch)
tree7d49733df88b2e500853d8335891adfa498a3d66 /synapse/storage/schema/signatures.sql
parentSign outgoing PDUs. (diff)
downloadsynapse-bb04447c44036ebf3ae5dde7a4cc7a7909d50ef6.tar.xz
Include hashes of previous pdus when referencing them
Diffstat (limited to 'synapse/storage/schema/signatures.sql')
-rw-r--r--synapse/storage/schema/signatures.sql16
1 files changed, 16 insertions, 0 deletions
diff --git a/synapse/storage/schema/signatures.sql b/synapse/storage/schema/signatures.sql
index 86ee0f2377..a72c4dc35f 100644
--- a/synapse/storage/schema/signatures.sql
+++ b/synapse/storage/schema/signatures.sql
@@ -34,3 +34,19 @@ CREATE TABLE IF NOT EXISTS pdu_origin_signatures (
 CREATE INDEX IF NOT EXISTS pdu_origin_signatures_id ON pdu_origin_signatures (
     pdu_id, origin
 );
+
+CREATE TABLE IF NOT EXISTS pdu_edge_hashes(
+    pdu_id TEXT,
+    origin TEXT,
+    prev_pdu_id TEXT,
+    prev_origin TEXT,
+    algorithm TEXT,
+    hash BLOB,
+    CONSTRAINT uniqueness UNIQUE (
+        pdu_id, origin, prev_pdu_id, prev_origin, algorithm
+    )
+);
+
+CREATE INDEX IF NOT EXISTS pdu_edge_hashes_id ON pdu_edge_hashes(
+    pdu_id, origin
+);