How to create unique lowercase index?
I'm trying to recreate the following sql statement. I don't think what I'm writing with the where clause is correct.
But writing
.on(sql
lower(domain))
results in a type error. Is there a way to do it in drizzle currently?
2 Replies
As a side note, how can I use
sql
when declaring the schema to run a check against the column (in postgres)? I note that the check function isn't implemented yet in drizzle-orm as per this. Just to confirm, this isn't possible via the sql operator either?
Also, is it possible to create a trigger
using the feature when defining the schema?
tldr; is it possible to use the sql`` command to create checks and triggers when defining the schema?Indexes & Constraints - DrizzleORM
Drizzle ORM | %s
I don't think you can currently do this with drizzle. I think you'll have to create a migration and add your SQL manually there
For a check in column you can make it work with customTypes