added an authenticated room websocket for messages

This commit is contained in:
2025-12-15 19:51:31 +01:00
parent 391a0d3f2e
commit ffc2e99cc7
8 changed files with 240 additions and 14 deletions

View File

@@ -28,6 +28,12 @@ CREATE TABLE IF NOT EXISTS message_ (
sent_at TIMESTAMP
);
CREATE TABLE ws_token_ (
token TEXT PRIMARY KEY,
room_id INT NOT NULL,
expires_at TIMESTAMPTZ NOT NULL
);
-- Message timestamp creation
CREATE OR REPLACE FUNCTION create_message_timestamp()
RETURNS trigger