CUBA IDEA Plugin error with table unique indexes

I created an unique index for a postgresql table manually and then added a corresponding @Index description into an entity source:

@Index(name = "idx_project_entity_index", columnList = "column1, column2, column3", unique = true)

I expect that CUBA Studio plugin would find a correspondence between database and entities structures but instead it generated two update SQL scripts:

drop index idx_project_entity_index ;
and
create index idx_project_entity_index on project_table (column1, column2, column3) ;

without an “unique” key word.
I think it’s a plugin bug.
CUBA Platform 6.10.9
CUBA Studio IDEA Plugin v10.0.NIGHTLY48-183

1 Like

Hi, Evgeny

Thanks for your feedback.

It is not actually a bug.
Studio doesn’t support unique parameter in the @Index annotation.
For unique indexes Studio uses another annotation:
@UniqueConstraint(name = "idx_project_entity_index", columnNames = {"column1", "column2", "column3"})
So you also need to use it in your entity source.

We will consider to support @Index annotation with unique parameter.