diff --git a/lib/tasks/data_migrations/example.rake b/lib/tasks/data_migrations/example.rake new file mode 100644 index 0000000000..2a08bfcedd --- /dev/null +++ b/lib/tasks/data_migrations/example.rake @@ -0,0 +1,21 @@ +# create new data migration rake task file and copy the contents of this file into it +# +# namespace :data_migrations do +# +# desc "" +# task example_data_migration_name: :environment do +# puts "Processing #{Lesson.count} lessons" +# +# progressbar = ProgressBar.create(total: Lesson.count, format: '%t: |%w%i| Completed: %c %a %e') +# +# Lesson.find_each do |lesson| +# begin +# # do something +# rescue StandardError => e +# progressbar.log "There was an error with lesson ##{lesson.id}: #{e.message}" +# ensure +# progressbar.increment +# end +# end +# end +# end