compound uniqueIndex

In Prisma, I have in my schema definition the following declaration that requires userId and timestamp tuple to be unique:
@@unique([userId, time])
@@unique([userId, time])
How can I express the same using drizzle kit schema file?
3 Replies
Andrii Sherman
GitHub
drizzle-orm/README.md at main · drizzle-team/drizzle-orm
TypeScript ORM for SQL. Contribute to drizzle-team/drizzle-orm development by creating an account on GitHub.
Andrii Sherman
You can find a part with namePopulationIdx
namePopulationIdx: index('name_population_idx').on(countries.name, countries.population), // multiple columns
namePopulationIdx: index('name_population_idx').on(countries.name, countries.population), // multiple columns
hotshoe
hotshoeOP2y ago
Thanks for the quick response!
Want results from more Discord servers?
Add your server