Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow creating GIN index on JSONB fields in Postgres adapter #7410

Closed
ansarizafar opened this issue Jun 2, 2021 · 5 comments · Fixed by prisma/prisma-engines#2858
Closed

Comments

@ansarizafar
Copy link

Problem

Prisma now allow filtering JSN fields but there is no way to create index on JSONB fields with schema definition language.

Suggested solution

Allow creating GIN index on JSONB fields in Postgres adapter with SDL.

@janpio janpio added kind/feature A request for a new feature. topic: Json Scalar type `Json` topic: schema team/schema Issue for team Schema. labels Jun 4, 2021
@sourdzl
Copy link

sourdzl commented Apr 6, 2022

does anyone have an example config of prisma not trying to drop a GIN index manually created directly in the database? i tried turning on extended features and adding a dummy @@Index, but couldn't figure out how to have prisma "ignore" the GIN index that wasn't specified in the schema file

@janpio
Copy link
Member

janpio commented Apr 6, 2022

That might not be possible right now 😞 As suggested in #12376 (comment), please describe your current experience in an issue please and we can look better into that. Thanks.

@janpio
Copy link
Member

janpio commented Apr 11, 2022

@janpio janpio mentioned this issue Apr 11, 2022
33 tasks
@sourdzl
Copy link

sourdzl commented Apr 11, 2022

thank you @janpio for the quick response!

it would be good to update the docs, which suggest its possible - https://www.prisma.io/docs/concepts/components/prisma-client/full-text-search
image

@janpio
Copy link
Member

janpio commented May 4, 2022

This is now available in our dev version, so you can use prisma@dev and the extendedIndexes preview feature if you want to play with it. Optimally start with a db pull on your existing database that uses these, and see if they are added correctly to the introspected schema. Afterwards you can also play with adding additional ones and then migrate (with db push or migrate dev).

Let us know how it goes please!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants
@pimeys @janpio @ansarizafar @sourdzl and others