X-Git-Url: https://git.sommitrealweird.co.uk/onak.git/blobdiff_plain/8e58a1769ce5e492dd68904dfc81b6e077fc2a3a..d27407c824b63bd0b9c78479453c3ce4799afac8:/onak.sql

diff --git a/onak.sql b/onak.sql
index 6afa737..3d68910 100644
--- a/onak.sql
+++ b/onak.sql
@@ -4,16 +4,21 @@ DROP TABLE onak_sigs;
 
 CREATE TABLE onak_keys (
 	keyid	char(16) NOT NULL,
-	keydata	oid NOT NULL
+	keydata	oid NOT NULL,
+	PRIMARY KEY (keyid)
 );
+CREATE INDEX onak_keys_keyid_index ON onak_keys(keyid);
 
 CREATE TABLE onak_uids (
 	keyid	char(16) NOT NULL,
 	uid	varchar(6000) NOT NULL,
-	pri	boolean
+	pri	boolean,
+	FOREIGN KEY (keyid) REFERENCES onak_keys
 );
 
 CREATE TABLE onak_sigs (
 	signer	char(16) NOT NULL,
-	signee	char(16) NOT NULL
+	signee	char(16) NOT NULL,
+	FOREIGN KEY (signee) REFERENCES onak_keys
 );
+CREATE INDEX onak_sigs_signee_index ON onak_sigs(signee);
