db/migrate/20181114112915_refactor_applications_audit.rb
def up
    add_column :completed_applications_audit, :metadata, :json, default: {}

    migrate_current_data!

    remove_column :completed_applications_audit, :saved
    remove_column :completed_applications_audit, :urgent_hearing
  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 up
    add_column :completed_applications_audit, :metadata, :json, default: {}
    migrate_current_data!
    remove_column :completed_applications_audit, :saved
    remove_column :completed_applications_audit, :urgent_hearing
  end
def up add_column :completed_applications_audit , :metadata , :json , default : { } migrate_current_data! remove_column :completed_applications_audit , :saved remove_column :completed_applications_audit , :urgent_hearing end
Current stored data is preserved and nothing is lost.
Current stored data is preserved and nothing is lost .