From 2f2388caabf1bc2944e26d3577aa0600d074a7b1 Mon Sep 17 00:00:00 2001 From: Frederick Holland Date: Thu, 23 Oct 2025 15:54:46 +1100 Subject: [PATCH] Added Calls to Participant via FK. Added User to Participant via FK. --- models/gencloud.go | 2 +- models/participant.go | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/models/gencloud.go b/models/gencloud.go index 4e5b354..4a62cc1 100644 --- a/models/gencloud.go +++ b/models/gencloud.go @@ -192,7 +192,7 @@ type UsersQuery struct { } type GCUser struct { - Id string `json:"id" gorm:"primaryKey"` + Id string `json:"id" gorm:"primaryKey;foreignKey"` Name string `json:"name"` Email string `json:"email"` State string `json:"state"` diff --git a/models/participant.go b/models/participant.go index 86c0ce3..03318c9 100644 --- a/models/participant.go +++ b/models/participant.go @@ -23,6 +23,8 @@ type DBParticipant struct { WrapupRequired *bool Sessions []DBSession `gorm:"foreignKey:ParticipantId;references:Id"` + Calls []DBCall `gorm:"foreignKey:ParticipantId;referencesId` + User GCUser `gorm:"foreignKey:UserId;references:Id` } func (DBParticipant) TableName() string {