Skip to content

Add index on deleted_at column#475

Merged
benadida merged 2 commits intomasterfrom
claude/add-deleted-at-index-gLDRB
Jan 19, 2026
Merged

Add index on deleted_at column#475
benadida merged 2 commits intomasterfrom
claude/add-deleted-at-index-gLDRB

Conversation

@benadida
Copy link
Owner

The deleted_at field is used by ElectionActiveManager to filter out soft-deleted elections on every query (deleted_at__isnull=True). Adding an index improves query performance.

The deleted_at field is used by ElectionActiveManager to filter out
soft-deleted elections on every query (deleted_at__isnull=True).
Adding an index improves query performance.
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 pull request adds a database index on the deleted_at column of the Election model to improve query performance. The deleted_at field is used by the custom ElectionManager to filter out soft-deleted elections in every query using deleted_at__isnull=True.

Changes:

  • Added db_index=True parameter to the deleted_at field in the Election model
  • Created migration 0009 to add the database index to the existing field

Reviewed changes

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

File Description
helios/models.py Added db_index=True to the deleted_at field definition
helios/migrations/0009_add_deleted_at_index.py Created migration to add index on deleted_at column

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@benadida benadida merged commit 6739a04 into master Jan 19, 2026
3 checks passed
@benadida benadida deleted the claude/add-deleted-at-index-gLDRB branch January 19, 2026 16:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants