File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -13,7 +13,7 @@ type Policy struct {
1313 Organization * Org `json:"organization" gorm:"foreignKey:OrganizationID;references:ID;constraint:OnDelete:CASCADE;"`
1414
1515 OpaqueID string `json:"opaqueId" gorm:"unique"` // only used by global policies maintained by the community and migrated by the system
16- Projects []Project `json:"projects" gorm:"many2many:project_enabled_policies;"`
16+ Projects []Project `json:"projects" gorm:"many2many:project_enabled_policies;constraint:OnDelete:CASCADE; "`
1717}
1818
1919func (m Policy ) TableName () string {
Original file line number Diff line number Diff line change @@ -35,7 +35,7 @@ type Project struct {
3535
3636 ConfigFiles database.JSONB `json:"configFiles" gorm:"type:jsonb"`
3737
38- EnabledPolicies []Policy `json:"enabledPolicies" gorm:"many2many:project_enabled_policies;"`
38+ EnabledPolicies []Policy `json:"enabledPolicies" gorm:"many2many:project_enabled_policies;constraint:OnDelete:CASCADE; "`
3939
4040 ExternalEntityID * string `json:"externalEntityId" gorm:"uniqueIndex:unique_external_entity;"`
4141 ExternalEntityProviderID * string `json:"externalEntityProviderId" gorm:"uniqueIndex:unique_external_entity;"`
You can’t perform that action at this time.
0 commit comments