From e6c4fdff268c902aad7f99cccfaf3d884c5473b5 Mon Sep 17 00:00:00 2001 From: Lakhan Samani Date: Fri, 7 Oct 2022 10:13:20 +0530 Subject: [PATCH] fix(server): text type for sql server 2019 Resolves #266 --- server/db/models/email_templates.go | 6 +++--- server/db/models/env.go | 4 ++-- server/db/models/user.go | 4 ++-- server/db/models/verification_requests.go | 6 +++--- server/db/models/webhook.go | 4 ++-- server/db/models/webhook_log.go | 4 ++-- 6 files changed, 14 insertions(+), 14 deletions(-) diff --git a/server/db/models/email_templates.go b/server/db/models/email_templates.go index 210848e..2383e2d 100644 --- a/server/db/models/email_templates.go +++ b/server/db/models/email_templates.go @@ -12,9 +12,9 @@ type EmailTemplate struct { Key string `json:"_key,omitempty" bson:"_key,omitempty" cql:"_key,omitempty"` // for arangodb ID string `gorm:"primaryKey;type:char(36)" json:"_id" bson:"_id" cql:"id"` EventName string `gorm:"unique" json:"event_name" bson:"event_name" cql:"event_name"` - Subject string `gorm:"type:text" json:"subject" bson:"subject" cql:"subject"` - Template string `gorm:"type:text" json:"template" bson:"template" cql:"template"` - Design string `gorm:"type:text" json:"design" bson:"design" cql:"design"` + Subject string `json:"subject" bson:"subject" cql:"subject"` + Template string `json:"template" bson:"template" cql:"template"` + Design string `json:"design" bson:"design" cql:"design"` CreatedAt int64 `json:"created_at" bson:"created_at" cql:"created_at"` UpdatedAt int64 `json:"updated_at" bson:"updated_at" cql:"updated_at"` } diff --git a/server/db/models/env.go b/server/db/models/env.go index 959284a..8ea4bc6 100644 --- a/server/db/models/env.go +++ b/server/db/models/env.go @@ -6,8 +6,8 @@ package models type Env struct { Key string `json:"_key,omitempty" bson:"_key,omitempty" cql:"_key,omitempty"` // for arangodb ID string `gorm:"primaryKey;type:char(36)" json:"_id" bson:"_id" cql:"id"` - EnvData string `gorm:"type:text" json:"env" bson:"env" cql:"env"` - Hash string `gorm:"type:text" json:"hash" bson:"hash" cql:"hash"` + EnvData string `json:"env" bson:"env" cql:"env"` + Hash string `json:"hash" bson:"hash" cql:"hash"` UpdatedAt int64 `json:"updated_at" bson:"updated_at" cql:"updated_at"` CreatedAt int64 `json:"created_at" bson:"created_at" cql:"created_at"` } diff --git a/server/db/models/user.go b/server/db/models/user.go index f8a054d..764b1dc 100644 --- a/server/db/models/user.go +++ b/server/db/models/user.go @@ -17,7 +17,7 @@ type User struct { Email string `gorm:"unique" json:"email" bson:"email" cql:"email"` EmailVerifiedAt *int64 `json:"email_verified_at" bson:"email_verified_at" cql:"email_verified_at"` - Password *string `gorm:"type:text" json:"password" bson:"password" cql:"password"` + Password *string `json:"password" bson:"password" cql:"password"` SignupMethods string `json:"signup_methods" bson:"signup_methods" cql:"signup_methods"` GivenName *string `json:"given_name" bson:"given_name" cql:"given_name"` FamilyName *string `json:"family_name" bson:"family_name" cql:"family_name"` @@ -27,7 +27,7 @@ type User struct { Birthdate *string `json:"birthdate" bson:"birthdate" cql:"birthdate"` PhoneNumber *string `gorm:"unique" json:"phone_number" bson:"phone_number" cql:"phone_number"` PhoneNumberVerifiedAt *int64 `json:"phone_number_verified_at" bson:"phone_number_verified_at" cql:"phone_number_verified_at"` - Picture *string `gorm:"type:text" json:"picture" bson:"picture" cql:"picture"` + Picture *string `json:"picture" bson:"picture" cql:"picture"` Roles string `json:"roles" bson:"roles" cql:"roles"` RevokedTimestamp *int64 `json:"revoked_timestamp" bson:"revoked_timestamp" cql:"revoked_timestamp"` IsMultiFactorAuthEnabled *bool `json:"is_multi_factor_auth_enabled" bson:"is_multi_factor_auth_enabled" cql:"is_multi_factor_auth_enabled"` diff --git a/server/db/models/verification_requests.go b/server/db/models/verification_requests.go index 992d9d8..be81cfc 100644 --- a/server/db/models/verification_requests.go +++ b/server/db/models/verification_requests.go @@ -13,12 +13,12 @@ import ( type VerificationRequest struct { Key string `json:"_key,omitempty" bson:"_key" cql:"_key,omitempty"` // for arangodb ID string `gorm:"primaryKey;type:char(36)" json:"_id" bson:"_id" cql:"id"` - Token string `gorm:"type:text" json:"token" bson:"token" cql:"jwt_token"` // token is reserved keyword in cassandra + Token string `json:"token" bson:"token" cql:"jwt_token"` // token is reserved keyword in cassandra Identifier string `gorm:"uniqueIndex:idx_email_identifier;type:varchar(64)" json:"identifier" bson:"identifier" cql:"identifier"` ExpiresAt int64 `json:"expires_at" bson:"expires_at" cql:"expires_at"` Email string `gorm:"uniqueIndex:idx_email_identifier;type:varchar(256)" json:"email" bson:"email" cql:"email"` - Nonce string `gorm:"type:text" json:"nonce" bson:"nonce" cql:"nonce"` - RedirectURI string `gorm:"type:text" json:"redirect_uri" bson:"redirect_uri" cql:"redirect_uri"` + Nonce string `json:"nonce" bson:"nonce" cql:"nonce"` + RedirectURI string `json:"redirect_uri" bson:"redirect_uri" cql:"redirect_uri"` CreatedAt int64 `json:"created_at" bson:"created_at" cql:"created_at"` UpdatedAt int64 `json:"updated_at" bson:"updated_at" cql:"updated_at"` } diff --git a/server/db/models/webhook.go b/server/db/models/webhook.go index cf7c460..7ced3c6 100644 --- a/server/db/models/webhook.go +++ b/server/db/models/webhook.go @@ -15,8 +15,8 @@ type Webhook struct { Key string `json:"_key,omitempty" bson:"_key,omitempty" cql:"_key,omitempty"` // for arangodb ID string `gorm:"primaryKey;type:char(36)" json:"_id" bson:"_id" cql:"id"` EventName string `gorm:"unique" json:"event_name" bson:"event_name" cql:"event_name"` - EndPoint string `gorm:"type:text" json:"endpoint" bson:"endpoint" cql:"endpoint"` - Headers string `gorm:"type:text" json:"headers" bson:"headers" cql:"headers"` + EndPoint string `json:"endpoint" bson:"endpoint" cql:"endpoint"` + Headers string `json:"headers" bson:"headers" cql:"headers"` Enabled bool `json:"enabled" bson:"enabled" cql:"enabled"` CreatedAt int64 `json:"created_at" bson:"created_at" cql:"created_at"` UpdatedAt int64 `json:"updated_at" bson:"updated_at" cql:"updated_at"` diff --git a/server/db/models/webhook_log.go b/server/db/models/webhook_log.go index 7305a1d..25b0bcf 100644 --- a/server/db/models/webhook_log.go +++ b/server/db/models/webhook_log.go @@ -14,8 +14,8 @@ type WebhookLog struct { Key string `json:"_key,omitempty" bson:"_key,omitempty" cql:"_key,omitempty"` // for arangodb ID string `gorm:"primaryKey;type:char(36)" json:"_id" bson:"_id" cql:"id"` HttpStatus int64 `json:"http_status" bson:"http_status" cql:"http_status"` - Response string `gorm:"type:text" json:"response" bson:"response" cql:"response"` - Request string `gorm:"type:text" json:"request" bson:"request" cql:"request"` + Response string `json:"response" bson:"response" cql:"response"` + Request string `json:"request" bson:"request" cql:"request"` WebhookID string `gorm:"type:char(36)" json:"webhook_id" bson:"webhook_id" cql:"webhook_id"` CreatedAt int64 `json:"created_at" bson:"created_at" cql:"created_at"` UpdatedAt int64 `json:"updated_at" bson:"updated_at" cql:"updated_at"`