{{{
GinIndex(
OpClass(Upper('text_id'), name='gin_trgm_ops'),
name='text_id_idx',
),
}}}
Migration file creates without any troubles on it.
sqlmigrate generates following SQL:
{{{
CREATE INDEX "text_id_idx" ON "auction_lot" USING gin ((UPPER("text_id")
gin_trgm_ops));
}}}
which obviously has one extra set of (), which causes following exception
during migration
{{{
django.db.utils.ProgrammingError: syntax error at or near "gin_trgm_ops"
LINE 1: ...dx" ON "auction_lot" USING gin ((UPPER("text_id") gin_trgm_o...
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/33021>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
* status: new => closed
* resolution: => invalid
* component: Migrations => Database layer (models, ORM)
Comment:
Thanks for this ticket, however you're seeing this error because of not
adding `django.contrib.postgres` to `INSTALLED_APPS`, see `OpClass()`
[https://docs.djangoproject.com/en/3.2/ref/contrib/postgres/indexes
/#opclass-expressions docs] and related ticket #32770.
--
Ticket URL: <https://code.djangoproject.com/ticket/33021#comment:1>