summaryrefslogtreecommitdiff
path: root/schema
diff options
context:
space:
mode:
authorSanto Cariotti <santo@dcariotti.me>2024-09-03 20:14:58 +0200
committerSanto Cariotti <santo@dcariotti.me>2024-09-03 20:15:52 +0200
commit32ba33078c2970b8658425260de287d6cde0db82 (patch)
tree3b3886a8eb2377fe021a054896cd5b7021b2e92e /schema
parente6cadc73edf20b4f959e8811cf7944d57fe6a5da (diff)
Add notification type
Diffstat (limited to 'schema')
-rw-r--r--schema/init.sql13
1 files changed, 13 insertions, 0 deletions
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)
+);