diff --git a/db/migrate/20160210153643_begin_psych_migration.rb b/db/migrate/20160210153643_begin_psych_migration.rb index dc78a3de8c1..0b3eb26edf7 100644 --- a/db/migrate/20160210153643_begin_psych_migration.rb +++ b/db/migrate/20160210153643_begin_psych_migration.rb @@ -2,7 +2,9 @@ class BeginPsychMigration < ActiveRecord::Migration tag :postdeploy def self.runnable? # TODO: Remove when we're ready to run this everywhere - if ApplicationController.respond_to?(:test_cluster?) + if ENV['RUN_PSYCH_MIGRATION'] + true + elsif ApplicationController.respond_to?(:test_cluster?) ApplicationController.test_cluster? else true diff --git a/lib/data_fixup/psych_migration.rb b/lib/data_fixup/psych_migration.rb index 365373c3583..58318209921 100644 --- a/lib/data_fixup/psych_migration.rb +++ b/lib/data_fixup/psych_migration.rb @@ -37,6 +37,10 @@ module DataFixup::PsychMigration end def migrate_yaml(progress, model, columns, start_at, end_at) + if progress + progress.set_results(progress.results.merge(:time_started_at => Time.now.utc)) + end + total_count = 0 unparsable_count = 0 changed_count = 0 @@ -93,7 +97,7 @@ module DataFixup::PsychMigration end end if progress - progress.set_results(progress.results.merge(:successful => true, :total_count => total_count, + progress.set_results(progress.results.merge(:time_finished_at => Time.now.utc, :successful => true, :total_count => total_count, :changed_count => changed_count, :unparsable_count => unparsable_count)) end end