Unique indexes when using Convex Ents
Hi people,
Given this example schema:
Is it possible to have a composite unique constraint on the contacts, such that it uniques by the
contact.email and the firm edge? I know I can do multiple fields for an index, but from what I can it only lets you chose fields defined on the table, not edges or foreign key relations.
Basically I want to able to enforce that two different firms can have the same contact, but a single firm can only the same contact once
Any insight appreciated, i've tried reading both the ents doco and db stuff and haven't been able to figure it out1 Reply
Thanks for posting in <#1088161997662724167>.
Reminder: If you have a Convex Pro account, use the Convex Dashboard to file support tickets.
- Provide context: What are you trying to achieve, what is the end-user interaction, what are you seeing? (full error message, command output, etc.)
- Use search.convex.dev to search Docs, Stack, and Discord all at once.
- Additionally, you can post your questions in the Convex Community's <#1228095053885476985> channel to receive a response from AI.
- Avoid tagging staff unless specifically instructed.
Thank you!