title: Foreign Key in Rails - Errors
body: <p>I'm trying to add a new foreign key column to my Customers table. This is my migration:</p>
  
  <pre><code>class AddCompanyForeignKeyToCustomers &lt; ActiveRecord::Migration[5.1]
    def change
      add_reference :customers, :company, foreign_key: true
      add_foreign_key :customers, :companies
    end
  end
  </code></pre>
  
  <p>These are the errors I'm getting:</p>
  
  <pre><code>rake aborted!
  StandardError: An error has occurred, this and all later migrations canceled:
  
  PG::DuplicateObject: ERROR:  constraint "fk_rails_ef51a916ef" for relation "customers" already exists
  : ALTER TABLE "customers" ADD CONSTRAINT "fk_rails_ef51a916ef"
  FOREIGN KEY ("company_id")
    REFERENCES "companies" ("id")
  
  ActiveRecord::StatementInvalid: PG::DuplicateObject: ERROR:  constraint "fk_rails_ef51a916ef" for relation "customers" already exists
  : ALTER TABLE "customers" ADD CONSTRAINT "fk_rails_ef51a916ef"
  FOREIGN KEY ("company_id")
    REFERENCES "companies" ("id")
  
  PG::DuplicateObject: ERROR:  constraint "fk_rails_ef51a916ef" for relation "customers" already exists
  </code></pre>
  
  <p>What does any of that mean? I don't know what fk_rails_$NUMBER is.</p>