Thank you, Jeremy! It did worked.

One last question. About migrations. I have a few foreign keys already 
declared and they are set to "on delete SET NULL". I would like to change 
them to "on delete CASCADE". I know there was a way of doing this but 
alter_table seems not mentioned about this. How can I change cascade styule 
for an existing foreign key using migrations?

Thanks,
Gencer.

On Tuesday, October 23, 2018 at 6:28:24 PM UTC+3, Jeremy Evans wrote:
>
> On Tuesday, October 23, 2018 at 7:46:47 AM UTC-7, genc wrote:
>>
>> Hi Jeremy,
>>
>> I dig into querying.md and can't find any example about "NOT EXISTS".
>>
>> How can we write this query in Sequel:
>>
>> select * from books where not exists (select * from writers where .....)
>>
>>
> I doubt NOT EXISTS would be documented explicitly.  However, you just need 
> to combine the NOT with the EXISTS:
>
>   DB[:books].exclude(DB[:writers].where(:foo).exists) 
>
> 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 sequel-talk+unsubscr...@googlegroups.com.
To post to this group, send email to sequel-talk@googlegroups.com.
Visit this group at https://groups.google.com/group/sequel-talk.
For more options, visit https://groups.google.com/d/optout.

Reply via email to