class UpdateUserfeebackMessageTime < ActiveRecord::Migration def up # user_feedback_count = UserFeedbackMessage.all.count / 30 + 1 # transaction do # for i in 1 ... user_feedback_count do i # UserFeedbackMessage.page(i).per(30).each do |ufm| # if ufm.journals_for_message # if ufm.journals_for_message.respond_to?("created_at") # ufm.created_at = ufm.journals_for_message.created_at # elsif ufm.journals_for_message.respond_to?("created_on") # ufm.created_at = ufm.journals_for_message.created_on # end # puts ufm.id # ufm.save # # user_feedback_messages = MessageAll.where("message_type = '#{ufm.class.to_s}' and message_id = '#{ufm.id}'").first # user_feedback_messages.created_at = ufm.created_at # user_feedback_messages.save # end # end # end # end end def down end end