refactor: shorten model and table prefixes
This commit is contained in:
@@ -2,23 +2,23 @@ package models
|
||||
|
||||
import "time"
|
||||
|
||||
type SenlinAgentAISession struct {
|
||||
ID uint `gorm:"primaryKey"`
|
||||
Identity string `gorm:"type:char(36);uniqueIndex"`
|
||||
ProjectID uint `gorm:"index;not null"`
|
||||
ProjectIdentity string `gorm:"type:char(36);index"`
|
||||
CreatedBy uint `gorm:"index;not null"`
|
||||
CreatedByIdentity string `gorm:"type:char(36);index"`
|
||||
ExpertID *uint `gorm:"index"`
|
||||
ExpertIdentity *string `gorm:"type:char(36);index"`
|
||||
Expert *SenlinAgentAIExpertItem `gorm:"foreignKey:ExpertID"`
|
||||
Title string `gorm:"not null"`
|
||||
Context string `gorm:"type:text"`
|
||||
Status string `gorm:"not null;default:ready"`
|
||||
type SaAISession struct {
|
||||
ID uint `gorm:"primaryKey"`
|
||||
Identity string `gorm:"type:char(36);uniqueIndex"`
|
||||
ProjectID uint `gorm:"index;not null"`
|
||||
ProjectIdentity string `gorm:"type:char(36);index"`
|
||||
CreatedBy uint `gorm:"index;not null"`
|
||||
CreatedByIdentity string `gorm:"type:char(36);index"`
|
||||
ExpertID *uint `gorm:"index"`
|
||||
ExpertIdentity *string `gorm:"type:char(36);index"`
|
||||
Expert *SaAIExpertItem `gorm:"foreignKey:ExpertID"`
|
||||
Title string `gorm:"not null"`
|
||||
Context string `gorm:"type:text"`
|
||||
Status string `gorm:"not null;default:ready"`
|
||||
CreatedAt time.Time
|
||||
UpdatedAt time.Time
|
||||
}
|
||||
|
||||
func (SenlinAgentAISession) TableName() string {
|
||||
return "senlin_agent_ai_sessions"
|
||||
func (SaAISession) TableName() string {
|
||||
return "sa_ai_sessions"
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user