Skip to content

Commit

Permalink
Merge pull request #158 from Revolyssup/db
Browse files Browse the repository at this point in the history
Change gorm tags for postgres compatibility
  • Loading branch information
Revolyssup authored Oct 12, 2022
2 parents 3bd9646 + a9dace8 commit ad682e4
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions pkg/model/model.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,21 +50,21 @@ type ResourceObjectMeta struct {
DeletionGracePeriodSeconds *int64 `json:"deletionGracePeriodSeconds,omitempty"`
Labels []*KeyValue `json:"labels,omitempty" gorm:"foreignkey:ID;references:id;constraint:OnUpdate:CASCADE,OnDelete:SET NULL;"`
Annotations []*KeyValue `json:"annotations,omitempty" gorm:"foreignkey:ID;references:id;constraint:OnUpdate:CASCADE,OnDelete:SET NULL;"`
OwnerReferences string `json:"ownerReferences,omitempty" gorm:"type:json"`
Finalizers string `json:"finalizers,omitempty" gorm:"type:json"`
OwnerReferences string `json:"ownerReferences,omitempty" gorm:"-"`
Finalizers string `json:"finalizers,omitempty" gorm:"-"`
ClusterName string `json:"clusterName,omitempty"`
ManagedFields string `json:"managedFields,omitempty" gorm:"type:json"`
ManagedFields string `json:"managedFields,omitempty" gorm:"-"`
ClusterID string `json:"cluster_id"`
}

type ResourceSpec struct {
ID string `json:"id" gorm:"primarykey"`
Attribute string `json:"attribute,omitempty" gorm:"type:json"`
Attribute string `json:"attribute,omitempty"`
}

type ResourceStatus struct {
ID string `json:"id" gorm:"primarykey"`
Attribute string `json:"attribute,omitempty" gorm:"type:json"`
Attribute string `json:"attribute,omitempty"`
}

func (obj *Object) BeforeCreate(tx *gorm.DB) (err error) {
Expand Down

0 comments on commit ad682e4

Please sign in to comment.