feat: initial commit
This commit is contained in:
24
models/organization.go
Normal file
24
models/organization.go
Normal file
@@ -0,0 +1,24 @@
|
||||
package models
|
||||
|
||||
import (
|
||||
"time"
|
||||
|
||||
"github.com/google/uuid"
|
||||
"gorm.io/gorm"
|
||||
)
|
||||
|
||||
type Organization struct {
|
||||
ID uuid.UUID `gorm:"type:uuid;primaryKey;default:uuid_generate_v4()" json:"id"`
|
||||
Name string `gorm:"unique;not null" json:"name"`
|
||||
DisplayName string `gorm:"not null" json:"display_name"`
|
||||
CreatedBy uuid.UUID `gorm:"type:uuid;" json:"created_by"`
|
||||
CreatedAt time.Time `json:"created_at"`
|
||||
UpdatedAt time.Time `json:"updated_at"`
|
||||
DeletedAt gorm.DeletedAt `gorm:"index" json:"-"`
|
||||
|
||||
Creator User `gorm:"foreignKey:CreatedBy" json:"creator,omitempty"`
|
||||
}
|
||||
|
||||
func (Organization) TableName() string {
|
||||
return "organizations"
|
||||
}
|
||||
Reference in New Issue
Block a user