How to add a unique for a combination?
This is my access schema:
The combination of organizationId and userId must be unique. But only the combination. How can I achieve that?
I'm using Postgresql.
Thank you so much.
2 Replies
have you tried this? https://orm.drizzle.team/docs/indexes-constraints#unique
Drizzle ORM - Indexes & Constraints
Drizzle ORM is a lightweight and performant TypeScript ORM with developer experience in mind.
It wasn't working but I just realized is, obviously, my fault. I was using on() in a field, not the table.
Thank you and sorry