implement backend components for push notifications

This commit is contained in:
talksik
2026-05-18 10:31:16 -07:00
parent 1618cb58cb
commit 6f476fe773
16 changed files with 904 additions and 60 deletions
@@ -0,0 +1 @@
DROP TABLE IF EXISTS push_tokens;
+10
View File
@@ -0,0 +1,10 @@
CREATE TABLE push_tokens (
token TEXT PRIMARY KEY,
human_id TEXT NOT NULL REFERENCES humans(id) ON DELETE CASCADE,
platform TEXT NOT NULL CHECK (platform IN ('ios', 'android')),
app_version TEXT,
created_at TIMESTAMPTZ NOT NULL DEFAULT NOW(),
last_seen_at TIMESTAMPTZ NOT NULL DEFAULT NOW()
);
CREATE INDEX push_tokens_human_id_idx ON push_tokens (human_id);