class ChangeReferenceToVersion < ActiveRecord::Migration[5.2] def change remove_reference :versions, :software, index: true, foreign_key: true change_table :versions do |t| t.references :branch, foreign_key: true end end end