jOOQ code generator does not generate corresponding Index if a UNIQUE index has the function defined on the field

Viewed 271

I have a unique index as below to achieve case-insensitive unique constraint on the project name

CREATE UNIQUE INDEX IF NOT EXISTS unique_project_name__idx ON project (UPPER(name));

It seems that jOOQ code generator does not generate the corresponding constant in Indexes.java for such UNIQUE index.

However, it works for the index without UPPER() function

CREATE UNIQUE INDEX IF NOT EXISTS unique_project_name__idx ON project (name);
// corresponding generation in Indexes.java
public static Index UNIQUE_PROJECT_NAME__IDX = Internal.createIndex("unique_project_name__idx", Project.PROJECT, new OrderField[] { Project.PROJECT.NAME }, true);

I use jOOQ 3.13.2 and PostgreSQL 11.2.

Any idea?

Is citext a better way for case-insensitive unique constraint?

1 Answers
Related