class CopyForgeActivitiesToOrgActivities < ActiveRecord::Migration
  def up
    count = ForgeActivity.all.count/30 + 1
    for i in 1 ... count do
      transaction do
        ForgeActivity.page(i).per(30).each do |forge_act|
          OrgActivity.create(:user_id => forge_act.user_id,
                             :org_act_id => forge_act.forge_act_id,
                             :org_act_type => forge_act.forge_act_type,
                             :container_id => forge_act.project_id,
                             :container_type => 'Project',
                             :created_at => forge_act.created_at,
                             :updated_at => forge_act.updated_at)
        end
      end
    end
  end

  def down
  end
end
