From 32ba33078c2970b8658425260de287d6cde0db82 Mon Sep 17 00:00:00 2001
From: Santo Cariotti <santo@dcariotti.me>
Date: Tue, 3 Sep 2024 20:14:58 +0200
Subject: Add notification type

---
 schema/init.sql | 13 +++++++++++++
 1 file changed, 13 insertions(+)

(limited to 'schema/init.sql')

diff --git a/schema/init.sql b/schema/init.sql
index bdf25cf..7c1c5b8 100644
--- a/schema/init.sql
+++ b/schema/init.sql
@@ -34,3 +34,16 @@ CREATE TABLE alerts(
     CONSTRAINT fk_users_id
         FOREIGN KEY(user_id) REFERENCES users(id)
 );
+
+CREATE TABLE notifications(
+    id SERIAL NOT NULL,
+    alert_id INTEGER NOT NULL,
+    position_id INTEGER NOT NULL,
+    seen BOOLEAN DEFAULT false,
+    created_at TIMESTAMPTZ NOT NULL DEFAULT NOW(),
+    PRIMARY KEY(id),
+    CONSTRAINT fk_alerts_id
+        FOREIGN KEY(alert_id) REFERENCES alerts(id),
+    CONSTRAINT fk_positions_id
+        FOREIGN KEY(position_id) REFERENCES positions(id)
+);
-- 
cgit v1.2.3-18-g5258

