Thank you for your help.
Is there a description of these operators in any manual or is it only 
available in Rdoc?

понедельник, 6 июля 2020 г. в 17:07:58 UTC+3, Jeremy Evans: 

> On Sunday, July 5, 2020 at 7:31:29 PM UTC-7, Aleksey Matskevich wrote:
>>
>>
>> In my application, a user can be identified by one of three fields - an 
>> nickname, a phone number or mail. None of the fields are required, but at 
>> least one must be completed. I am trying to make a check, which requires 
>> filling one of the three fields.
>> In SQL, I would write something like this:
>> ...sql
>> CONSTRAINT username_email_phone_number_notnull CHECK (
>>   NOT (nickname IS NULL and email IS NULL and phone_number IS NULL)
>> )
>> ```
>> How to write such a restriction in sequel?
>>
>
> constraint :username_email_phone_number_notnull, Sequel.~(nickname: nil, 
> email: nil, phone_number: nil) 
> CONSTRAINT username_email_phone_number_notnull CHECK ((nickname IS NOT 
> NULL) OR (email IS NOT NULL) OR (phone_number IS NOT NULL))
>
> Thanks,
> Jeremy
>

-- 
You received this message because you are subscribed to the Google Groups 
"sequel-talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sequel-talk/61415393-7f15-499d-8a51-eed18a82a3b8n%40googlegroups.com.

Reply via email to