how can i index a non-unique field in typescript prisma schemas?
👀 1
nick
08/12/2022, 8:01 PM
or do i have to manually index them on the DB maybe, seems i can’t have two fields with @id in schema syntax
n
Nurul
08/16/2022, 7:26 AM
Hey Nick 👋
Could you please elaborate on what is your use case?
It isn’t required that the fields on which you want to create an index should be unique, here’s a reference for defining index
v
Vladi Stevanovic
08/29/2022, 8:09 PM
👋 Hello @nick - did you have a chance to check Nurul's comment? Let us know if this is still an open question!
n
nick
10/19/2022, 1:42 PM
@Nurul@Vladi Stevanovic I’ve worked past it, I wanted to have a compound ID in addition to the primary ID but it appears you can’t?
a
Austin
10/26/2022, 9:07 PM
@nick It is only possible to have either a composite ID or a single primary key.
You can define multiple compound indexes, though.