summaryrefslogtreecommitdiff
path: root/schema/init.sql
diff options
context:
space:
mode:
Diffstat (limited to 'schema/init.sql')
-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)
+);