I have a table with an "e-mail address" and "P2PMail address" column. The user is required to either enter an e-mail or P2PMail address.
If I set both to NOT NULL
, then both must be filled in for a record to be created.
If I allow both to be NULL
, then a user would be entirely unreachable.
If I set a UNIQUE CONSTRAINT
on both columns, then the combination of them must be unique, but it says nothing about what I'm trying to do... unless I'm mis-thinking here.
What is the correct way to accomplish this? I fear that the answer is something unpleasant such as "triggers" or something. (I was never comfortable using those.)