Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add db_index on the added_on model field to improve sorting/filtering and make a migration. #102

Open
tsantor opened this issue Oct 29, 2024 · 1 comment

Comments

@tsantor
Copy link

tsantor commented Oct 29, 2024

class BaseModel(models.Model):
        id = models.BigAutoField(primary_key=True, db_index=True)

        added_on = models.DateTimeField()

        def __str__(self):
            return str(self.id)

        class Meta:
            abstract = True
            ordering = ('-added_on',)
@vishalanandl177
Copy link
Owner

Hello @tsantor,

The decision to add indexes is left to the developer's discretion. Some may choose to include partitioning or multi-column indexes. Please feel free to add indexes manually based on your specific requirements.

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

No branches or pull requests

2 participants