diff --git a/database/entities/refresh_token_entity.go b/database/entities/refresh_token_entity.go index a41df38..ea924e8 100644 --- a/database/entities/refresh_token_entity.go +++ b/database/entities/refresh_token_entity.go @@ -7,12 +7,14 @@ import ( ) type RefreshToken struct { - ID uuid.UUID `gorm:"type:uuid;primary_key;default:uuid_generate_v4()" json:"id"` - UserID uuid.UUID `gorm:"type:uuid;not null" json:"user_id"` - TenantID uuid.UUID `gorm:"type:uuid;not null" json:"tenant_id"` + ID uuid.UUID `gorm:"type:uuid;primary_key;default:uuid_generate_v4()" json:"id"` + UserID uuid.UUID `gorm:"type:uuid;not null" json:"user_id"` + ClientID uuid.UUID `gorm:"type:uuid;not null" json:"client_id"` + // TenantID uuid.UUID `gorm:"type:uuid;not null" json:"tenant_id"` Token string `gorm:"type:varchar(255);not null;uniqueIndex" json:"token"` ExpiresAt time.Time `gorm:"type:timestamp with time zone;not null" json:"expires_at"` - User User `gorm:"foreignKey:UserID;constraint:OnUpdate:CASCADE,OnDelete:CASCADE;" json:"-"` - Tenant Tenant `gorm:"foreignKey:TenantID;constraint:OnUpdate:CASCADE,OnDelete:CASCADE;" json:"-"` + User M_User `gorm:"foreignKey:UserID;constraint:OnUpdate:CASCADE,OnDelete:CASCADE;" json:"-"` + // Tenant Tenant `gorm:"foreignKey:TenantID;constraint:OnUpdate:CASCADE,OnDelete:CASCADE;" json:"-"` + Timestamp }