From ecc6a55aba7bb35fc778e7a53848396b88214151 Mon Sep 17 00:00:00 2001
From: Leonardo Bishop <me@leonardobishop.com>
Date: Sat, 23 Aug 2025 22:29:28 +0100
Subject: Add multiple conferences feature

---
 pkg/database/query/favourites.sql | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

(limited to 'pkg/database/query/favourites.sql')

diff --git a/pkg/database/query/favourites.sql b/pkg/database/query/favourites.sql
index 94e914c..a903ac7 100644
--- a/pkg/database/query/favourites.sql
+++ b/pkg/database/query/favourites.sql
@@ -1,12 +1,16 @@
+-- name: GetFavouritesForUserConference :many
+SELECT * FROM favourites
+WHERE user_id = $1 AND conference_id = $2;
+
 -- name: GetFavouritesForUser :many
 SELECT * FROM favourites
 WHERE user_id = $1;
 
 -- name: CreateFavourite :one
 INSERT INTO favourites (
-  user_id, event_guid, event_id
+  user_id, event_guid, event_id, conference_id
 ) VALUES (
-  $1, $2, $3
+  $1, $2, $3, $4
 )
 RETURNING *;
 
@@ -16,4 +20,4 @@ WHERE id = $1;
 
 -- name: DeleteFavouriteByEventDetails :execrows
 DELETE FROM favourites
-WHERE (event_guid = $1 OR event_id = $2) AND user_id = $3;
+WHERE (event_guid = $1 OR event_id = $2) AND user_id = $3 AND conference_id = $4;
-- 
cgit v1.2.3-70-g09d2

