fix: use char(36) with golang uuid instead of sql uuid type (#78)
resolves #77
This commit is contained in:
parent
4d341e9876
commit
155d2e65c2
|
@ -9,7 +9,7 @@ import (
|
|||
)
|
||||
|
||||
type Role struct {
|
||||
ID uuid.UUID `gorm:"type:uuid;"`
|
||||
ID uuid.UUID `gorm:"primaryKey;type:char(36)"`
|
||||
Role string `gorm:"unique"`
|
||||
}
|
||||
|
||||
|
|
|
@ -9,8 +9,8 @@ import (
|
|||
)
|
||||
|
||||
type Session struct {
|
||||
ID uuid.UUID `gorm:"type:uuid;"`
|
||||
UserID uuid.UUID `gorm:"type:uuid;"`
|
||||
ID uuid.UUID `gorm:"primaryKey;type:char(36)"`
|
||||
UserID uuid.UUID `gorm:"type:char(36)"`
|
||||
User User
|
||||
UserAgent string
|
||||
IP string
|
||||
|
|
|
@ -10,16 +10,16 @@ import (
|
|||
)
|
||||
|
||||
type User struct {
|
||||
ID uuid.UUID `gorm:"type:uuid;"`
|
||||
ID uuid.UUID `gorm:"primaryKey;type:char(36)"`
|
||||
FirstName string
|
||||
LastName string
|
||||
Email string `gorm:"unique"`
|
||||
Password string
|
||||
Password string `gorm:"type:text"`
|
||||
SignupMethod string
|
||||
EmailVerifiedAt int64
|
||||
CreatedAt int64 `gorm:"autoCreateTime"`
|
||||
UpdatedAt int64 `gorm:"autoUpdateTime"`
|
||||
Image string
|
||||
Image string `gorm:"type:text"`
|
||||
Roles string
|
||||
}
|
||||
|
||||
|
|
|
@ -9,8 +9,8 @@ import (
|
|||
)
|
||||
|
||||
type VerificationRequest struct {
|
||||
ID uuid.UUID `gorm:"type:uuid;"`
|
||||
Token string `gorm:"index"`
|
||||
ID uuid.UUID `gorm:"primaryKey;type:char(36)"`
|
||||
Token string `gorm:"type:text"`
|
||||
Identifier string
|
||||
ExpiresAt int64
|
||||
CreatedAt int64 `gorm:"autoCreateTime"`
|
||||
|
|
Loading…
Reference in New Issue
Block a user