I have the following table:
I must set a rule in that entity, so you can't have the same home_account_user_id
and same account_status
twice for example:
id | home_account_user_id | account_status
0 | 1 | AWAY
0 | 1 | AWAY
Should be:
id | home_account_user_id | account_status
0 | 1 | AWAY
0 | 1 | CLOSED
Is there a way to define it this way?
You could use UNIQUE
constraint/index:
CREATE UNIQUE INDEX udx_name ON tab_name(home_account_user_id, account_status);