Yes, exactly. Django doc tells they do the same. And they do, but if you do
not specify db_index=False in field, both indexes are created.
Here is exaplanation
:
https://stackoverflow.com/questions/53966256/django-db-index-true-not-creating-index-but-class-meta-indexes-yes
El domingo, 30 de di
django automatically creates an index for foreign key columns, unless you
specify db_index=False for that field.
what I suspect is happening here, you're telling django that it should have
two indices for that particular column covering identical areas of
responsibility.
--
You received this
I have a model like this (simplified code):
class Agreement(modes.Model):
job = models.ForeignKey(...)
class Meta:
indexes = (
models.Index(fields=['job']),
)
And when run migrations, the index is created.
BUT, after doing this:
clas
3 matches
Mail list logo