Hi,
I tried to use design time roles for an application, but I was unable to assign more than one role.
The problem seems to be the index IDX_SEC_USER_ROLE_UNIQ_ROLE
:
As the field ROLE_ID
is null for design time roles, it is not possible to assign more than one at the same time.
I wasn’t able to reproduce this problem when using PostgreSQL or HSQL. Probably because of different treatment of null values in these databases (I think oracle treats nulls as equals in unique constraints). I’m not sure, but I think this situation will to happen to MSSQL as well.
I was able to workaround the problem changing the index:
DROP INDEX "IDX_SEC_USER_ROLE_UNIQ_ROLE";
CREATE UNIQUE INDEX "IDX_SEC_USER_ROLE_UNIQ_ROLE" ON "SEC_USER_ROLE" ("USER_ID", "ROLE_ID", "ROLE_NAME", "DELETE_TS");
Is this a valid workaround? Or is there another solution?
Thanks!
Regards,
Peterson.