How to make sys$user.email unique

I UserExt class to extends sys$User, i can add attr into user , but how can i modified the SYS_USER to make the email unique?

thanks.

image
how can I make users’ emails unique in the system?

by add unique index on sys_user.email ,
or how can i override the email in class Sys$User?

Hi,
The most reliable is to create unique index in the database.

Don’t forget about delete_ts field:
https://doc.cuba-platform.com/manual-7.1/soft_deletion_unique_constr.html

Hi Alex,
Thanks for your reply.

I am doubt that is it possible to modified the attribute in the sys$User like this case, to make the email unique in the code , so that the db script generator could also auto create the index?

You can just put index creation statement to the 30.create-db.sql database creation script. There is no need to change data model.