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/migrations/0003_multi_conference.sql | 13 +++++++++++++
 1 file changed, 13 insertions(+)
 create mode 100644 pkg/database/migrations/0003_multi_conference.sql

(limited to 'pkg/database/migrations/0003_multi_conference.sql')

diff --git a/pkg/database/migrations/0003_multi_conference.sql b/pkg/database/migrations/0003_multi_conference.sql
new file mode 100644
index 0000000..31a1f58
--- /dev/null
+++ b/pkg/database/migrations/0003_multi_conference.sql
@@ -0,0 +1,13 @@
+-- +goose Up
+CREATE TABLE conferences (
+    id int GENERATED BY DEFAULT AS IDENTITY PRIMARY KEY,
+    url text NOT NULL,
+    title text,
+    venue text,
+    city text
+);
+
+TRUNCATE TABLE favourites CONTINUE IDENTITY;
+ALTER TABLE favourites ADD conference_id int NOT NULL REFERENCES conferences(id) ON DELETE CASCADE;
+ALTER TABLE favourites DROP CONSTRAINT favourites_user_id_event_guid_event_id_key;
+ALTER TABLE favourites ADD UNIQUE(user_id, event_guid, event_id, conference_id);
-- 
cgit v1.2.3-70-g09d2

