title: Change reference to different model rails migration
body: <p>How can I migrate the <code>Referral</code> table to point to point to the <code>PatientProfile</code> id instead of the <code>User</code> id for an existing database (i.e. would like to migrate all existing rows)?</p>
  
  <pre><code>class User
    belongs_to :profile, polymorphic: true
    has_many :referrals
  
  class PatientProfile
    has_one :user, as: :profile
  
  class Referral
    belongs_to :user
  </code></pre>
  
  <p>I could accomplish this by simply making a migration and renaming the <code>user_id</code> column to be <code>patient_profile_id</code> and changing the reference in the model, however that would not migrate over existing records. </p>