On Friday, May 24, 2019 at 10:39:48 AM UTC-7, xura wrote:
>
> Hi,
>
> Following is an :gin index for jsonb fields:
>
> CREATE INDEX index_name
> ON public.emails
> USING gin
> (send_cc, send_bcc, send_to, sender);
>
> So, in Sequel docs no :Gin mentioned. Is there a better way to do this
> without writing RAW SQL inside migrations?
>
GIN isn't a special keyword, it's just an index type like btree or gist.
You can use the :type option:
DB.add_index :emails, [:send_cc, :send_bcc, :send_to, :sender] ,
:name=>:index_name, :type=>:gin
# CREATE INDEX "index_name" ON "emails" USING gin ("send_cc", "send_bcc",
"send_to", "sender")
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 post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/sequel-talk.
To view this discussion on the web visit
https://groups.google.com/d/msgid/sequel-talk/4a8b44f0-9972-41ce-8d0b-e938596d0b9f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.