Skip to content

Add DB indexes for key fields#135

Merged
dkhalife merged 2 commits intomainfrom
codex/add-indexes-to-taskid,-userid,-and-createdby
Jul 7, 2025
Merged

Add DB indexes for key fields#135
dkhalife merged 2 commits intomainfrom
codex/add-indexes-to-taskid,-userid,-and-createdby

Conversation

@dkhalife
Copy link
Owner

@dkhalife dkhalife commented Jul 7, 2025

Summary

  • index notification TaskID and UserID
  • add indexes on CreatedBy for tasks and labels

Testing

  • go test ./...

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

Copilot AI review requested due to automatic review settings July 7, 2025 03: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

This PR adds database indexes to improve query performance on key fields.

  • Adds an index tag to the CreatedBy field in the Task and Label models
  • Adds index tags to the TaskID and UserID fields in the Notification model

Reviewed Changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

File Description
internal/models/task.go Added index tag for CreatedBy field
internal/models/notification.go Added index tags for TaskID and UserID fields
internal/models/label.go Added index tag for CreatedBy field
Comments suppressed due to low confidence (2)

internal/models/task.go:14

  • Ensure that your database migration or AutoMigrate call is updated to actually create this new index in the production schema.
	CreatedBy    int                        `json:"-" gorm:"column:created_by;not null;index"`

internal/models/label.go:9

  • Add a schema or integration test to verify that this new index exists after migrations are applied.
	CreatedBy int        `json:"created_by" gorm:"column:created_by;not null;index"`

@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 ac18821 into main Jul 7, 2025
5 checks passed
@dkhalife dkhalife deleted the codex/add-indexes-to-taskid,-userid,-and-createdby branch July 7, 2025 03:13
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