From 65302bf60206ea43213e7f2bc18adf15838cf3a2 Mon Sep 17 00:00:00 2001
From: user <user@node5.net>
Date: Thu, 21 Mar 2024 23:05:08 +0100
Subject: initial commit, logs login attempts to DB

---
 create_db.sql | 14 ++++++++++++++
 1 file changed, 14 insertions(+)
 create mode 100644 create_db.sql

(limited to 'create_db.sql')

diff --git a/create_db.sql b/create_db.sql
new file mode 100644
index 0000000..c7c2d5c
--- /dev/null
+++ b/create_db.sql
@@ -0,0 +1,14 @@
+CREATE TABLE connection (
+    id          serial PRIMARY KEY,
+    ip          inet,
+    port        INT,
+    timestamp   TIMESTAMPTZ DEFAULT CURRENT_TIMESTAMP
+);
+
+CREATE TABLE login_attempt (
+	id			serial PRIMARY KEY,
+	username	text NOT NULL,
+	password	text NOT NULL,
+	connection  int references connection(id),
+    timestamp   TIMESTAMPTZ DEFAULT CURRENT_TIMESTAMP
+);
-- 
cgit v1.2.3

