by semiquaver · 3y ago · 0 comments
In this case, a `user_uris` table with non-nullable columns and a unique constraint on `user_id` is the first option that comes to mind.
It might prevent error if you only rely on INNER JOIN but that's rarely the case at least for me (you often want to access the record anyways).
Much safer to deal with the NULL at the application level.
You can build a constraint to check that if it's in the same table, but across tables it seems to be a bit more complex right ?