1 class RenameOpenidUrl < ActiveRecord::Migration[4.2]
3 rename_column :users, :openid_url, :auth_uid
4 add_column :users, :auth_provider, :string
6 User.where.not(:auth_uid => nil).update_all(:auth_provider => "openid")
8 add_index :users, [:auth_provider, :auth_uid], :unique => true, :name => "users_auth_idx"
9 remove_index :users, :column => :auth_uid, :unique => true, :name => "user_openid_url_idx"