con = ActiveRecord::Base.connection 1_000_000.times do |i| time = Time.now con.execute("INSERT INTO users (name, email, created_at, updated_at) VALUES ('Fjord#{i}', 'hogehoge#{i}@example.com', '#{time}', '#{time}')") end end end
users" do users = [] 1_000_000.times do |i| now = Time.now users << { name: "FJORD#{i}", email: "hogehoge#{i}@example.com", created_at: now, updated_at: now } end User.insert_all(users) end end