diff --git a/internal/infra/models/execution.go b/internal/infra/models/execution.go index d549cd7..96c55d9 100644 --- a/internal/infra/models/execution.go +++ b/internal/infra/models/execution.go @@ -184,7 +184,7 @@ type UserActionLog struct { Time time.Time `gorm:"primaryKey" json:"time"` // --- Who (谁) --- - UserID uint `gorm:"primaryKey" json:"user_id,omitempty"` + UserID uint `gorm:"not null" json:"user_id,omitempty"` Username string `json:"username,omitempty"` // 操作发生时用户名的快照 // --- Where (何地) ---