refactor: clients now have a single websocket that handles all rooms the user is in

This commit is contained in:
2026-01-16 11:35:07 +01:00
parent 376353833c
commit 37e6bb25fc
8 changed files with 74 additions and 66 deletions

View File

@@ -57,7 +57,6 @@ CREATE TABLE IF NOT EXISTS message_ (
CREATE TABLE ws_token_ (
token TEXT PRIMARY KEY,
room_id INT NOT NULL,
expires_at TIMESTAMPTZ NOT NULL
);

View File

@@ -29,9 +29,9 @@ INSERT INTO friendship_ (user_first, user_second) VALUES
INSERT INTO friend_request_ (sender, receiver) VALUES
(2, 1); -- Bob sent a friend request to Alice
INSERT INTO ws_token_ (token, room_id, expires_at) VALUES
('random_token_1', 1, '2025-12-31T23:59:59Z'),
('random_token_2', 2, '2025-12-31T23:59:59Z');
INSERT INTO ws_token_ (token, expires_at) VALUES
('random_token_1', '2025-12-31T23:59:59Z'),
('random_token_2', '2025-12-31T23:59:59Z');
INSERT INTO room_invite_ (sender, receiver, room) VALUES
(2, 1, 2);