title: How can I remove a unique constraint from a database column in Rails?
body: <p>I created a table using the following migration: </p>
  
  <pre><code>class CreateProfilePictures &lt; ActiveRecord::Migration
    def change
      create_table :profile_pictures do |t|
        t.integer :user_id, null: false
        t.integer :picture_id, null: false
        t.timestamps null: false
      end
  
      add_index :profile_pictures, :user_id, unique: true
      add_index :profile_pictures, :picture_id, unique: true
    end
  end
  </code></pre>
  
  <p>I tried to remove the constraint with the following: </p>
  
  <pre><code>class FixProfilePic &lt; ActiveRecord::Migration
    def change
      change_column :profile_pictures, :picture_id, :integer, unique: false
    end
  end
  </code></pre>
  
  <p>I still get a unique constraint violation error if I try to use the same picture_id in more than one place. What is the proper way to remove the uniqueness constraint from  picture_id?</p>