How to create unique nullable compound index in Tarantool 1.10
?
I have a space of 4 columns:
| id | user_id | type | {some data} |
The pair | user_id | type |
should be unique if type column is not null. user_id
should never be null.
Examples:
OK:
| 1 | 1 | 1 |
| 2 | 1 | 2 |
| 3 | 2 | 1 |
OK:
| 1 | 1 | 1 |
| 2 | 1 | 2 |
| 3 | 1 | NULL |
| 4 | 1 | NULL |
| 5 | 2 | 1 |
NOT OK:
| 1 | 1 | 1 |
| 2 | 1 | 1 |
| 3 | 1 | NULL |
NOT OK:
| 1 | 1 | 1 |
| 2 | NULL | <any> |