On Friday, August 24, 2012 10:02:50 AM UTC-7, Marc Cooper wrote: > > Hi, > > I'm trying to perform a migration that adds a column populated with the > lower case contents of an existing column. > > The following runs, populates the column, but the downcase is discarded: > > add_column :users, :uname, String > self[:users].update(:uname => :screen_name.downcase) > > So, I'm just using: > > add_column :users, :uname, String > self[:users].update(:uname => :screen_name) > > and trying to somehow invoke: > > update users set uname = lower(uname) > > But I can't figure out how to do this. > self[:users].update(:uname => Sequel.function(:lower, :uname))
or with the core extensions: self[:users].update(:uname => :lower.sql_function(:uname)) Jeremy -- You received this message because you are subscribed to the Google Groups "sequel-talk" group. To view this discussion on the web visit https://groups.google.com/d/msg/sequel-talk/-/TguedJ71EkIJ. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/sequel-talk?hl=en.
