﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
30214	Indexes defined on abstract base classes are not propagated to subclasses	wKavey	nobody	"It seems that if I define a model with Meta.abstract=True then any indexes I define in that model are not propgated to subclasses.

Example:
{{{
class CustomBase(models.Model):
    id = models.AutoField(primary_key=True)
    name = models.CharField(max_length=100)

    class Meta:
        abstract = True
        indexes = [
            models.Index(fields=['name'], name='name_idx')
        ]

class CustomSub(CustomBase):
    ip_address = models.GenericIPAddressField()

    class Meta:
        indexes = [
            models.Index(fields=['ip_address'], name='ip_address')
        ]
}}}

Then


{{{
>> python manage.py makemigrations
- Create model CustomSub                                           
- Create index ip_address on field(s) ip_address of model customsub
}}}

No mention of index 'name_idx' from the base class

"	Bug	closed	Database layer (models, ORM)	2.1	Normal	invalid	abstract base class		Unreviewed	0	0	0	0	0	0
