Case insensitive uniqueness validation in a Ruby Sequel.migration
===

I'm trying to figure out a good validation to use in my migration that will require case-insensitive uniqueness for user email addresses.  In short, I want something like `validate :email, :uniqueness => {:case_sensitive => false}` without having to convert everything to use Rails or ActiveRecord.  I could run emails through regexes but I don't like that solution.

I found a comment[1] saying you could use  
`validates_unique(:email){ |ds| ds.opts[:where].args.map! { |x| Sequel.function(:lower, x)}; ds}`  
but I don't understand what that code is doing and I don't want to use that code when I have no idea what that `ds` object is or what all is going on (why `map!`, does postgresql have a `Sequel.function` of `:lower`? ... probably, but I just don't know.)

[1] http://comments.gmane.org/gmane.comp.lang.ruby.sequel/6447

So I need one of two things answered:  
1) How do I perform a case-insensitive uniqueness validation in a pure `Sequel.migration` (no ActiveRecord, no Rails)?  
- OR -    
2) If that code snippet I found online is actually what I want, what does it do & how does it work?  (What is the `ds` object and what does this validation do with my database?)