class RenameRevisionHoldItem < ActiveRecord::Migration[5.1] def change remove_column :revisions, :hold_item, :integer change_table :revisions do |t| t.references :item end add_foreign_key :revisions, :items, column: :item_id end end