added global rooms in backend and fixed room membership checks

This commit is contained in:
2025-12-17 17:14:39 +01:00
parent ffc2e99cc7
commit d20962101e
5 changed files with 81 additions and 65 deletions

View File

@@ -3,14 +3,13 @@ INSERT INTO user_ (username, email, uuid, password_hash) VALUES
('bob', 'bob@example.com', '019b1e36-3b8c-7f82-b845-6bfeb72466ce', '$argon2id$v=19$m=19456,t=2,p=1$mzO6Qx8ZH4/wrj14ZgKiuA$7bxNWCgsIVEfPgtueFbjbi8mDjbAHMYAHOGpxTJnEpQ'),
('carol', 'carol@example.com', '019b1e36-7706-76e2-b9ce-b37916ddfc99', '$argon2id$v=19$m=19456,t=2,p=1$5rw/7uIJIKMnyqNrYQt92Q$DJVEfgbaZtkflsmDEkSoR3uDQmujI4T73cWq9hOBgVI');
INSERT INTO room_ (owner, name, uuid) VALUES
(1, 'General Discussion', '5dc599ee-1f5c-40c2-a22a-e40780d2d960'),
(2, 'Tech Talk', '6b14fe7b-2171-4464-95af-4888062b1b6d'),
(1, 'Random Memes', 'fb794f59-6b2d-4daa-8980-dc5255862657');
INSERT INTO room_ (owner, name, global, uuid) VALUES
(1, 'General Discussion', true, '5dc599ee-1f5c-40c2-a22a-e40780d2d960'),
(2, 'Tech Talk', false, '6b14fe7b-2171-4464-95af-4888062b1b6d'),
(1, 'Random Memes', false, 'fb794f59-6b2d-4daa-8980-dc5255862657');
INSERT INTO membership_ (user_id, room) VALUES
(1, 1), -- Alice in General Discussion
(2, 1), -- Bob in General Discussion
(2, 2), -- Bob in Tech Talk
(3, 1), -- Carol in General Discussion
(1, 3); -- Alice in Random Memes