From 105f6831d13ebb473b6ce9b63c5c159b5a6c964d Mon Sep 17 00:00:00 2001 From: Santo Cariotti Date: Thu, 12 Sep 2024 11:46:27 +0200 Subject: Each alert has text{1,2,3} for the three possible area Alert level is moved to the notification struct --- schema/init.sql | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'schema/init.sql') diff --git a/schema/init.sql b/schema/init.sql index 7397619..df76581 100644 --- a/schema/init.sql +++ b/schema/init.sql @@ -29,7 +29,9 @@ CREATE TABLE alerts( user_id INTEGER NOT NULL, created_at TIMESTAMPTZ NOT NULL DEFAULT NOW(), area GEOMETRY(Polygon, 4326), - level level_alert NOT NULL, + text1 text NOT NULL, + text2 text NOT NULL, + text3 text NOT NULL, reached_users INTEGER DEFAULT 0 NOT NULL, PRIMARY KEY(id), CONSTRAINT fk_users_id @@ -41,6 +43,7 @@ CREATE TABLE notifications( alert_id INTEGER NOT NULL, position_id INTEGER NOT NULL, seen BOOLEAN DEFAULT false, + level level_alert NOT NULL, created_at TIMESTAMPTZ NOT NULL DEFAULT NOW(), PRIMARY KEY(id), CONSTRAINT fk_alerts_id -- cgit v1.2.3-18-g5258