Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add gorm type for JSONB fields #7975

Merged
merged 2 commits into from
Mar 11, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 4 additions & 5 deletions backend/model/model.go
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,6 @@ var Models = []interface{}{
&IntegrationWorkspaceMapping{},
&EmailOptOut{},
&BillingEmailHistory{},
&Retryable{},
&Service{},
&SetupEvent{},
&SessionAdminsView{},
Expand Down Expand Up @@ -713,7 +712,7 @@ type Session struct {
Environment string `json:"environment"`
AppVersion *string `json:"app_version"`
ServiceName string
UserObject JSONB `json:"user_object" sql:"type:jsonb"`
UserObject JSONB `json:"user_object" sql:"type:jsonb" gorm:"type:jsonb"`
UserProperties string `json:"user_properties"`
// Whether this is the first session created by this user.
FirstTime *bool `json:"first_time" gorm:"default:false"`
Expand All @@ -733,7 +732,7 @@ type Session struct {
// The version of Highlight's Firstload.
FirstloadVersion string `json:"firstload_version"`
// The client configuration that the end-user sets up. This is used for debugging purposes.
ClientConfig *string `json:"client_config" sql:"type:jsonb"`
ClientConfig *string `json:"client_config" sql:"type:jsonb" gorm:"type:jsonb"`
// Determines whether this session should be viewable. This enforces billing.
WithinBillingQuota *bool `json:"within_billing_quota" gorm:"default:true"`
// Used for shareable links. No authentication is needed if IsPublic is true
Expand Down Expand Up @@ -1266,7 +1265,7 @@ type TimelineIndicatorEvent struct {
Timestamp float64
Type int
SID float64
Data JSONB `json:"data" sql:"type:jsonb"`
Data JSONB `json:"data" sql:"type:jsonb" gorm:"type:jsonb"`
}

type RageClickEvent struct {
Expand Down Expand Up @@ -1404,7 +1403,7 @@ type Retryable struct {
Type RetryableType
PayloadType string
PayloadID string
Payload JSONB `sql:"type:jsonb"`
Payload JSONB `sql:"type:jsonb" gorm:"type:jsonb"`
Error string
}

Expand Down
Loading