You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi, given the release of trigram indexes, I have tried to implement them in my django app. However, the migrations are failing. From what I can tell, django-cockroachdb hasn't been updated to support them yet (as seen here)
The output from python manage.py sqlmigrate confirms this:
When using engine django_cockroachdb, output shows CREATE INDEX "study_firstName" ON "study_study" USING gist ("firstName");
When using engine django.db.backends.postgresql, output shows CREATE INDEX "study_firstName" ON "study_study" USING gist ("firstName" gist_trgm_ops);
The text was updated successfully, but these errors were encountered:
Thanks for this. contrib.postgres isn't currently supported but perhaps we can work toward the goal of supporting the bits of that package that CockroachDB does support. Alternatively, or in addition, we might create a contrib.cockroach type package that includes the bits of contrib.postgres that CockroachDB supports, and perhaps some other things e.g. HashShardedIndex.
As for this issue, there are two possible ways to create the index:
I'm not familiar enough with Django internals & contribs to work out a proper solution but I've managed to make it work through the first way, i.e. monkey-patching _index_columns back to postgres's.
from django_cockroachdb.schema import DatabaseSchemaEditor
from django.db.backends.postgresql.schema import (DatabaseSchemaEditor as PostgresDatabaseSchemaEditor)
DatabaseSchemaEditor._index_columns = PostgresDatabaseSchemaEditor._index_columns
This wouldn't check against unsupported opclasses though, but is fine for my case :)
Hi, given the release of trigram indexes, I have tried to implement them in my django app. However, the migrations are failing. From what I can tell, django-cockroachdb hasn't been updated to support them yet (as seen here)
The output from
python manage.py sqlmigrate
confirms this:When using engine
django_cockroachdb
, output showsCREATE INDEX "study_firstName" ON "study_study" USING gist ("firstName");
When using engine
django.db.backends.postgresql
, output showsCREATE INDEX "study_firstName" ON "study_study" USING gist ("firstName" gist_trgm_ops);
The text was updated successfully, but these errors were encountered: