class ChangeUserIndeces < ActiveRecord::Migration
  def self.up
    remove_index :users, :email

    add_index :users, :email, unique: false, using: 'btree'
    add_index :users, column: [:provider, :uid], unique: true, using: 'btree'

  end

  def self.down
    remove_index :users, :email
    remove_index :users, column: [:provider, :uid]

    add_index :users, :email, unique: true, using: 'btree'
  end
end

Add User table index migrartion
Add User table index migrartion

Prepare a migration to change the indeces on the users table:
  - Remove the unique requirement for the users' email index
  - Add an index over the provider and uid columns
