From 02475e05ccd1aa15c6a6163834f28bfebbef796f Mon Sep 17 00:00:00 2001 From: Rutger Broekhoff Date: Mon, 30 Nov 2026 11:47:36 +0100 Subject: RWGPS webhook and such --- server/migrations/2_rwgps_up.sql | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 server/migrations/2_rwgps_up.sql (limited to 'server/migrations/2_rwgps_up.sql') diff --git a/server/migrations/2_rwgps_up.sql b/server/migrations/2_rwgps_up.sql new file mode 100644 index 0000000..569479b --- /dev/null +++ b/server/migrations/2_rwgps_up.sql @@ -0,0 +1,22 @@ +CREATE TABLE rwgps_notification ( + id INTEGER PRIMARY KEY AUTOINCREMENT, + rwgps_timestamp TEXT NOT NULL, + user_id INTEGER NOT NULL, + item_type TEXT, -- NULL if unknown + item_id INTEGER, + item_user_id INTEGER, + item_url TEXT, + action_ TEXT, -- NULL if unknown + CHECK (rwgps_timestamp IS strftime('%FT%TZ', rwgps_timestamp)), + CHECK (item_type IN ('trip', 'route', 'event', 'event_participant', 'club_member', 'authorization')), + CHECK (action_ IN ('created', 'updated', 'deleted', 'added', 'removed')) +) STRICT; + +CREATE TABLE rwgps_notification_target_collection ( + notification_id INTEGER PRIMARY KEY, + id INTEGER NOT NULL, + type_ TEXT, -- NULL if unknown + url TEXT, + CHECK (type_ IN ('pinned')), + FOREIGN KEY (notification_id) REFERENCES rwgps_notification (id) +) STRICT; -- cgit v1.3.1