Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions apiserver/internal/models/task.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ type TaskHistory struct {
}

type TaskLabel struct {
TaskID int `json:"task_id"`
LabelID int `json:"label_id"`
TaskID int `json:"task_id" gorm:"primaryKey"`
LabelID int `json:"label_id" gorm:"primaryKey"`
Comment on lines +33 to +34
Copy link

Copilot AI Dec 27, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The GORM tag uses camelCase primaryKey, but the rest of the codebase consistently uses snake_case primary_key for GORM primary key tags. For consistency with the existing codebase (see models like Task, Label, User, TaskHistory, AppToken, etc.), this should be changed to gorm:"primary_key" instead of gorm:"primaryKey".

Suggested change
TaskID int `json:"task_id" gorm:"primaryKey"`
LabelID int `json:"label_id" gorm:"primaryKey"`
TaskID int `json:"task_id" gorm:"primary_key"`
LabelID int `json:"label_id" gorm:"primary_key"`

Copilot uses AI. Check for mistakes.
}

type CreateTaskReq struct {
Expand Down
1 change: 1 addition & 0 deletions apiserver/internal/utils/migration/migration.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ func Migration(db *gorm.DB) error {
models.AppToken{},
models.Label{},
models.Task{},
models.TaskLabel{},
models.TaskHistory{},
models.NotificationSettings{},
models.Notification{},
Expand Down
Loading