@unique on optional field
and
As you can see, user_id is an optional field. However the relation REQUIRES it to be marked as unique. In doing so, I get the following error: duplicate key { user_id: null }
I imagine this will be an issue for excluded emails too, though I haven't run into it yet