Skip to content

Add index for TaskHistory.task_id#138

Merged
dkhalife merged 1 commit intomainfrom
codex/add-indexes-on-task-id-and-foreign-keys
Jul 7, 2025
Merged

Add index for TaskHistory.task_id#138
dkhalife merged 1 commit intomainfrom
codex/add-indexes-on-task-id-and-foreign-keys

Conversation

@dkhalife
Copy link
Owner

@dkhalife dkhalife commented Jul 7, 2025

Summary

  • index task_histories.task_id with friendly name idx_task_histories_task_id

Testing

  • go test ./...

https://chatgpt.com/codex/tasks/task_e_686b6259943c832abef7086632ea346b

Copilot AI review requested due to automatic review settings July 7, 2025 06:03
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

Adds a GORM index on the task_id column of the task_histories table to improve lookup performance.

  • Updated the TaskHistory.TaskID field tag to include index:idx_task_histories_task_id
Comments suppressed due to low confidence (1)

internal/models/task.go:27

  • Consider adding a corresponding database migration script to create the idx_task_histories_task_id index on the task_histories table, as updating the GORM tag alone won't apply the index to existing databases.
	TaskID        int        `json:"task_id" gorm:"column:task_id;not null;index:idx_task_histories_task_id"`

@codecov
Copy link

codecov bot commented Jul 7, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

📢 Thoughts on this report? Let us know!

@dkhalife dkhalife merged commit 1f80cf9 into main Jul 7, 2025
5 checks passed
@dkhalife dkhalife deleted the codex/add-indexes-on-task-id-and-foreign-keys branch July 7, 2025 06:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants