games表增加user_id的索引

video_transcode
daiao 5 years ago
parent 4e32534698
commit a02c622293

@ -0,0 +1,5 @@
class AddUserIdIndexForGames < ActiveRecord::Migration[5.2]
def change
add_index :games, :user_id
end
end

@ -2,7 +2,7 @@ desc "统计每个学校使用数据"
namespace :static_all do
task :repo => :environment do
school_alls = School.includes(:courses, user_extensions: :user).all
school_alls = School.includes(courses: [:homework_commons, :attachments, :course_videos], user_extensions: :user).where(id: 117)
proc_num = ENV['processes'].blank? ? 5 : ENV['processes'].to_i
school_alls.find_in_batches(batch_size: 50) do |schools|
Parallel.each(schools, in_processes: proc_num) do |school|

Loading…
Cancel
Save