#35274: Avoid creating index using db_index=False for a CharField which is a primary key -------------------------------------+------------------------------------- Reporter: | Owner: nobody ChamathAilapperuma | Type: Bug | Status: new Component: Database | Version: 4.2 layer (models, ORM) | Keywords: primary_key, Severity: Normal | db_index Triage Stage: | Has patch: 0 Unreviewed | Needs documentation: 0 | Needs tests: 0 Patch needs improvement: 0 | Easy pickings: 0 UI/UX: 0 | -------------------------------------+------------------------------------- I'm trying to remove all the unused indexes from my db and figured that there are some primary key indexes created by Django. Following is an example for a model that I need to remove those indexes from.
{{{ class TeamName(models.Model): team_name = models.CharField(max_length=64, primary_key=True) }}} I tried adding db_index=False to above team_name field expecting it to avoid creating the index for the primary key. But it does not create a migration for this change. Thus it does not remove the corresponding index with name ending "_like". All of my models having CharField as primary key behaves the same. -- Ticket URL: <https://code.djangoproject.com/ticket/35274> Django <https://code.djangoproject.com/> The Web framework for perfectionists with deadlines. -- You received this message because you are subscribed to the Google Groups "Django updates" group. To unsubscribe from this group and stop receiving emails from it, send an email to django-updates+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/django-updates/0107018e12428f40-d16ddf58-b659-4840-97c8-e1ebec49cac4-000000%40eu-central-1.amazonses.com.