load all data

pull/1/head
Jared Cosulich 6 years ago
parent 26cb9c5bb3
commit 126bd5429a

@ -1,7 +1,7 @@
# PSQL: /Applications/Postgres.app/Contents/Versions/9.6/bin/psql -h localhost # PSQL: /Applications/Postgres.app/Contents/Versions/9.6/bin/psql -h localhost
# LOAD DATA # LOAD DATA
# RAILS_ENV=development rails db:environment:set db:drop db:create db:migrate; /Applications/Postgres.app/Contents/Versions/9.6/bin/pg_restore --verbose --clean --no-acl --no-owner -h localhost -d mciea_development latest.dump; rake db:migrate; # RAILS_ENV=development rails db:environment:set db:drop db:create db:migrate; /Applications/Postgres.app/Contents/Versions/9.6/bin/pg_restore --verbose --clean --no-acl --no-owner -h localhost -d mciea_development beta-data-071819.dump; rake db:migrate;
# rails c -> SchoolCategory.update_all(year: '2017') # rails c -> SchoolCategory.update_all(year: '2017')
# rake data:load_questions_csv; rake data:load_responses # rake data:load_questions_csv; rake data:load_responses
@ -310,7 +310,6 @@ namespace :data do
t = Time.new t = Time.new
csv.each_with_index do |row, index| csv.each_with_index do |row, index|
next if index < startIndex next if index < startIndex
break if index > 100
if Time.new - startTime >= timeToRun || index > stopIndex if Time.new - startTime >= timeToRun || index > stopIndex
puts("ENDING #{timeToRun} SECONDS: #{Time.new - startTime} = #{startIndex} -> #{index} = #{index - startIndex} or #{(Time.new - t) / (index - startIndex)} per second") puts("ENDING #{timeToRun} SECONDS: #{Time.new - startTime} = #{startIndex} -> #{index} = #{index - startIndex} or #{(Time.new - t) / (index - startIndex)} per second")

Loading…
Cancel
Save