From c9579cb9ca2a6a165d10f128e0af1dfd372e0c03 Mon Sep 17 00:00:00 2001
From: Ellie Huxtable <e@elm.sh>
Date: Sun, 21 Mar 2021 20:04:39 +0000
Subject: Implement server (#23)

* Add initial database and server setup

* Set up all routes, auth, etc

* Implement sessions, password auth, hashing with argon2, and history storage
---
 migrations/2021-03-20-151809_create_history/up.sql | 11 +++++++++++
 1 file changed, 11 insertions(+)
 create mode 100644 migrations/2021-03-20-151809_create_history/up.sql

(limited to 'migrations/2021-03-20-151809_create_history/up.sql')

diff --git a/migrations/2021-03-20-151809_create_history/up.sql b/migrations/2021-03-20-151809_create_history/up.sql
new file mode 100644
index 00000000..7cb19fc7
--- /dev/null
+++ b/migrations/2021-03-20-151809_create_history/up.sql
@@ -0,0 +1,11 @@
+-- Your SQL goes here
+-- lower case SQL please, this isn't a shouting match
+create table history (
+	id bigserial primary key,
+	client_id text not null unique, -- the client-generated ID
+	user_id bigserial not null,     -- allow multiple users
+	mac varchar(128) not null,      -- store a hashed mac address, to identify machines - more likely to be unique than hostname
+	timestamp timestamp not null,   -- one of the few non-encrypted metadatas
+
+	data varchar(8192) not null     -- store the actual history data, encrypted. I don't wanna know!
+);
-- 
cgit v1.3.1

