class AddUniquenessConstraintToRepos < ActiveRecord::Migration
  def change
    remove_index :repos, :github_id
    add_index :repos, [:user_id, :github_id], unique: true
  end
end

class AddUniquenessConstraintToRepos < ActiveRecord::Migration
  def up
    remove_index :repos, :github_id
    add_index :repos, [:user_id, :github_id], unique: true
  end

  def down
    remove_index :repos, [:user_id, :github_id]
    add_index :repos, :github_id
  end
end

Make uniqueness constraint migration reversible
Make uniqueness constraint migration reversible

* Add down method to AddUniquenessConstraintToRepos to make migration
  reversible
* https://trello.com/c/jgd1zB9q
