From b2425fa5e65e7171a7697f70f07f071055a2f734 Mon Sep 17 00:00:00 2001 From: iamdoubz <> Date: Wed, 1 Jul 2026 15:08:07 -0500 Subject: [PATCH] Add calendar_event_participants table and dedup index for PST re-imports --- .../migrations/0005_calendar_attendees.sql | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 src-tauri/migrations/0005_calendar_attendees.sql diff --git a/src-tauri/migrations/0005_calendar_attendees.sql b/src-tauri/migrations/0005_calendar_attendees.sql new file mode 100644 index 0000000..fb89de4 --- /dev/null +++ b/src-tauri/migrations/0005_calendar_attendees.sql @@ -0,0 +1,19 @@ +-- WhispAssist calendar-event attendees schema (Phase 6, T6.1/T6.2, FR-CAL-1). +-- Forward-only migration. Mirrors docs/03-data-model.md. +PRAGMA foreign_keys = ON; + +-- Attendees per imported calendar event (populated at import time from the +-- source's own attendee list, e.g. a .pst appointment's ATTENDEE lines) — +-- distinct from meeting_participants, which links a *recording* to people +-- once a meeting is attached to an event (T6.3/T6.6). +CREATE TABLE calendar_event_participants ( + calendar_event_id TEXT NOT NULL REFERENCES calendar_events(id) ON DELETE CASCADE, + participant_id TEXT NOT NULL REFERENCES participants(id), + role TEXT, -- organizer|required|optional + PRIMARY KEY (calendar_event_id, participant_id) +); + +-- Dedup re-imports of the same PST (or the same event across multiple PSTs +-- from the same source kind) by the source's own stable UID. +CREATE UNIQUE INDEX idx_calendar_events_source_uid ON calendar_events(source, raw_uid) + WHERE raw_uid IS NOT NULL;