diff options
| author | Leonardo Bishop <me@leonardobishop.com> | 2025-08-23 22:29:28 +0100 |
|---|---|---|
| committer | Leonardo Bishop <me@leonardobishop.com> | 2025-08-23 22:29:28 +0100 |
| commit | ecc6a55aba7bb35fc778e7a53848396b88214151 (patch) | |
| tree | 1b37a2dc5f4594155114da1ae0c4529d20a4c548 /pkg/database/migrations/0003_multi_conference.sql | |
| parent | 8f7dec8ba6b2f9bde01afd0a110596ebbd43e0ed (diff) | |
Add multiple conferences feature
Diffstat (limited to 'pkg/database/migrations/0003_multi_conference.sql')
| -rw-r--r-- | pkg/database/migrations/0003_multi_conference.sql | 13 |
1 files changed, 13 insertions, 0 deletions
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); |
