Skip to content
tagliala edited this page Dec 25, 2012 · 13 revisions

Welcome to the icare wiki!

Upgrading scripts

From 0.6.3 to 0.6.4+

User.all.each { |u| u.update_attribute :username_or_uid, [u.username, u.uid] }
User.all.each { |u| u.references.each { |r| r.set(:read_at, r.read); r.unset :read } }
Conversation.all.each { |c| c.messages.each { |m| m.set(:read_at, m.read); m.unset :read } }

run rake db:mongoid:create_indexes too

From 0.5.2 to 0.5.3+

User.all.each do |u|
  u.references.all.each do |r|
    r.set :incoming, r[:references_incoming] if r[:references_incoming]
    r.set :outgoing, r[:references_outgoing] if r[:references_outgoing]
    r.unset :references_incoming
    r.unset :references_outgoing
  end
end
Clone this wiki locally