add agent ddl draft

This commit is contained in:
Efim Poberezkin committed 2020-12-27 22:06:37 +04:00
1 parent e418498334
commit a6bd03bf99
1 file changed
+38 -5
@@ -18,15 +18,48 @@ createSchema conn =
recipientQueues :: Query
recipientQueues =
"CREATE TABLE IF NOT EXISTS recipient_queues\
\ ( id INTEGER PRIMARY KEY,\
\ rcvId TEXT\
\ ( recipient_queue_id INTEGER PRIMARY KEY,\
\ server TEXT,\
\ rcv_id TEXT,\
\ rcv_private_key TEXT,\
\ snd_id TEXT,\
\ snd_key TEXT,\
\ decrypt_key TEXT,\
\ verify_key TEXT,\
\ status TEXT,\
\ ack_mode INTEGER\
\ )"
senderQueues :: Query
senderQueues = ""
senderQueues =
"CREATE TABLE IF NOT EXISTS sender_queues\
\ ( sender_queue_id INTEGER PRIMARY KEY,\
\ server TEXT,\
\ snd_id TEXT,\
\ snd_private_key TEXT,\
\ encrypt_key TEXT,\
\ sign_key TEXT,\
\ status TEXT,\
\ ack_mode INTEGER\
\ )"
connections :: Query
connections = ""
connections =
"CREATE TABLE IF NOT EXISTS connections\
\ ( connection_id INTEGER PRIMARY KEY,\
\ conn_alias TEXT UNIQUE,\
\ recipient_queue_id INTEGER REFERENCES recipient_queues(recipient_queue_id),\
\ sender_queue_id INTEGER REFERENCES sender_queues(sender_queue_id)\
\ )"
messages :: Query
messages = ""
messages =
"CREATE TABLE IF NOT EXISTS messages\
\ ( message_id INTEGER PRIMARY KEY,\
\ conn_alias TEXT REFERENCES connections(conn_alias),\
\ agent_msg_id INTEGER,\
\ timestamp TEXT,\
\ message TEXT,\
\ direction TEXT,\
\ msg_status TEXT\
\ )"