Re: db_index=True not working, and indexes in class Meta yes

2018-12-29 Thread Gonzalo Amadio
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

Re: db_index=True not working, and indexes in class Meta yes

2018-12-29 Thread Jason
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

db_index=True not working, and indexes in class Meta yes

2018-12-28 Thread Gonzalo Amadio
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