@@ -147,27 +147,29 @@ type ResourceType string
147147type Relationship string
148148
149149// Resource reference table models the relationship between resources in a loosely coupled way.
150+ // This model has a composite primary key consisting of ResourceUUID, ResourceType, and ReferenceType.
151+ // Updated for GORM v2 compatibility.
150152type ResourceReference struct {
151153 // ID of the resource object
152- ResourceUUID string `gorm:"column:ResourceUUID; not null; primary_key ;"`
154+ ResourceUUID string `gorm:"column:ResourceUUID; not null; primaryKey ;"`
153155
154156 // The type of the resource object
155- ResourceType ResourceType `gorm:"column:ResourceType; not null; primary_key ; index:referencefilter;"`
157+ ResourceType ResourceType `gorm:"column:ResourceType; not null; primaryKey ; index:referencefilter;"`
156158
157- // The ID of the resource that been referenced to .
159+ // The ID of the referenced resource .
158160 ReferenceUUID string `gorm:"column:ReferenceUUID; not null; index:referencefilter;"`
159161
160- // The name of the resource that been referenced to .
162+ // The name of the referenced resource .
161163 ReferenceName string `gorm:"column:ReferenceName; not null;"`
162164
163- // The type of the resource that been referenced to .
164- ReferenceType ResourceType `gorm:"column:ReferenceType; not null; primary_key ; index:referencefilter;"`
165+ // The type of the referenced resource .
166+ ReferenceType ResourceType `gorm:"column:ReferenceType; not null; primaryKey ; index:referencefilter;"`
165167
166- // The relationship between the resource object and the resource that been referenced to .
168+ // The relationship between the resource object and the referenced resource .
167169 Relationship Relationship `gorm:"column:Relationship; not null;"`
168170
169- // The json formatted blob of the resource reference.
170- Payload string `gorm:"column:Payload; not null; size:65535; "`
171+ // JSON-encoded metadata blob about the reference
172+ Payload string `gorm:"column:Payload; not null; size:65535"`
171173}
172174
173175type ReferenceKey struct {
0 commit comments