X-Git-Url: http://www.project-moonshot.org/gitweb/?a=blobdiff_plain;f=schema.sql;h=752fe2ce46cc6b42832fdf128e0444efb3d770bb;hb=ef677b2b70f9e79bc1660bfbacba3a40ce74304f;hp=f5acc4a795fa508e75e40cc79b50d8ed7ee0f3dc;hpb=3f2f7c0b61b33e22ca937809e5a80e68c7490609;p=trust_router.git diff --git a/schema.sql b/schema.sql index f5acc4a..752fe2c 100644 --- a/schema.sql +++ b/schema.sql @@ -1,6 +1,7 @@ -create table if not exists psk_keys (keyid text primary key, key blob, client_dh_pub raw(20), key expiration timestamp); +create table if not exists psk_keys_tab(keyid text primary key, key blob, client_dh_pub raw(20), key_expiration timestamp); create table if not exists authorizations( client_dh_pub raw(20), coi string, acceptor_realm string, hostname string, apc string); create index if not exists authorizations_dhpub on authorizations( client_dh_pub); +create view if not exists psk_keys as select * from psk_keys_tab where datetime(key_expiration) > datetime('now'); CREATE VIEW if not exists authorizations_keys as select keyid, authorizations.* from psk_keys join authorizations on psk_keys.client_dh_pub = authorizations.client_dh_pub;