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(sqllower(domain)) results in a type error. Is there a way to do it in drizzle currently?

create unique index sso_domains_domain_idx on auth.sso_domains using btree (lower(domain)) tablespace pg_default;


export const ssoDomains = authSchema.table(
  "sso_domains",
    {
      domain: text("domain").notNull(),
    },
    table => ({
      ssoDomainsDomainIdx: uniqueIndex("sso_domains_domain_idx").on(table.domain).where(sql`lower(${table.domain.name})`),
    })
);
Was this page helpful?