I'm trying to check the uniqueness where for the same values in the column APP will exist only specific value in the column STATUS.
Example:
Each app can be only once "true".
APP cannot be a PRIMARY KEY.
The DB should restrict adding additional row with (app1, true) and permit (app1, false)
| ID | APP | STATUS |
|---|---|---|
| 1 | app1 | false |
| 2 | app1 | true |
| 3 | app1 | false |
| 4 | app2 | false |
| 5 | app2 | false |
| 6 | app2 | false |
| 7 | app2 | true |
Maybe constraint, or indexing can help here?