diff --git a/shared/core/src/commonMain/sqldelight/org/gdglille/devfest/db/24.sqm b/shared/core/src/commonMain/sqldelight/org/gdglille/devfest/db/24.sqm index 353ce38f1..2c9763d7e 100644 --- a/shared/core/src/commonMain/sqldelight/org/gdglille/devfest/db/24.sqm +++ b/shared/core/src/commonMain/sqldelight/org/gdglille/devfest/db/24.sqm @@ -56,3 +56,5 @@ event_id TEXT NOT NULL, FOREIGN KEY (speaker_id) REFERENCES Speaker(id), FOREIGN KEY (talk_id) REFERENCES TalkSession(id) ); + +CREATE UNIQUE INDEX TalkSessionWithSpeakersIndex ON TalkSessionWithSpeakers(speaker_id, talk_id, event_id); diff --git a/shared/core/src/commonMain/sqldelight/org/gdglille/devfest/db/Session.sq b/shared/core/src/commonMain/sqldelight/org/gdglille/devfest/db/Session.sq index 016b21f61..e66c87285 100644 --- a/shared/core/src/commonMain/sqldelight/org/gdglille/devfest/db/Session.sq +++ b/shared/core/src/commonMain/sqldelight/org/gdglille/devfest/db/Session.sq @@ -38,6 +38,8 @@ FOREIGN KEY (speaker_id) REFERENCES Speaker(id), FOREIGN KEY (talk_id) REFERENCES TalkSession(id) ); +CREATE UNIQUE INDEX TalkSessionWithSpeakersIndex ON TalkSessionWithSpeakers(speaker_id, talk_id, event_id); + selectSessions: SELECT Session.id, Session.order_, Session.event_id, Session.date, Session.start_time, Session.end_time, Session.room, Session.is_favorite, Session.talk_id, TalkSession.title, TalkSession.abstract, TalkSession.level, TalkSession.language, TalkSession.slide_url, TalkSession.replay_url, TalkSession.open_feedback_url,