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
Andrii Sherman16mo ago
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
Andrii Sherman16mo ago
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
hotshoe16mo ago
Thanks for the quick response!