replace id type
This commit is contained in:
@@ -9,11 +9,11 @@ type Organization struct {
|
||||
ID uuid.UUID `gorm:"type:uuid;default:gen_random_uuid();primarykey"`
|
||||
gorm.Model
|
||||
Name string `json:"name" gorm:"unique;index"`
|
||||
ParentID uint `json:"parent_id"`
|
||||
ParentID uuid.UUID `json:"parent_id"`
|
||||
Positions []Position `json:"positions,omitempty"`
|
||||
}
|
||||
|
||||
type OrganizationApi struct {
|
||||
Name string `json:"name" gorm:"unique;index"`
|
||||
ParentID uint `json:"parent_id"`
|
||||
ParentID uuid.UUID `json:"parent_id"`
|
||||
}
|
||||
|
||||
@@ -10,12 +10,12 @@ type Position struct {
|
||||
gorm.Model
|
||||
Name string `json:"name" gorm:"unique;index"`
|
||||
RightMask int `json:"right_mask"`
|
||||
OrganizationID uint `json:"organization_id" gorm:"index;not null"`
|
||||
OrganizationID uuid.UUID `json:"organization_id" gorm:"index;not null"`
|
||||
Users []User `json:"users,omitempty"`
|
||||
}
|
||||
|
||||
type PositionApi struct {
|
||||
Name string `json:"name" gorm:"unique;index"`
|
||||
RightMask int `json:"right_mask"`
|
||||
OrganizationID uint `json:"organization_id" gorm:"index;not null"`
|
||||
OrganizationID uuid.UUID `json:"organization_id" gorm:"index;not null"`
|
||||
}
|
||||
|
||||
@@ -20,5 +20,5 @@ type APIUser struct {
|
||||
FirstName string `json:"first_name"`
|
||||
LastName string `json:"last_name"`
|
||||
Role string `json:"role" gorm:"default:employee"`
|
||||
PositionID uint `json:"position_id,omitempty"`
|
||||
PositionID uuid.UUID `json:"position_id,omitempty"`
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user