db/migrate/20181114112915_refactor_applications_audit.rb
def migrate_current_data!
    CompletedApplicationsAudit.all.each do |record|
      record.update_column(:metadata, {
        saved_for_later: record.saved,
        urgent_hearing: record.urgent_hearing,
      })
    end
  end
#
# Current stored data is preserved and nothing is lost.
# We just move around some fields to the new `metadata` column.
# Rollback will not restore to the previous state but this is on purpose.
#
Current stored data is preserved and nothing is lost.
We just move around some fields to the new `metadata` column.
Rollback will not restore to the previous state but this is on purpose.
Current stored data is preserved and nothing is lost . We just move around some fields to the new ` metadata ` column . Rollback will not restore to the previous state but this is on purpose .
def migrate_current_data!
    CompletedApplicationsAudit.all.each do |record|
      record.update_column(:metadata, {
        saved_for_later: record.saved,
        urgent_hearing: record.urgent_hearing,
      })
    end
  end
def migrate_current_data! CompletedApplicationsAudit . all . each do | record | record . update_column ( :metadata , { saved_for_later : record . saved , urgent_hearing : record . urgent_hearing , } ) end end
Current stored data is preserved and nothing is lost.
Current stored data is preserved and nothing is lost .