Convert OpenID authentication to generic third party authentication
This commit is contained in:
parent
eaf4b32a7f
commit
e434cb154c
14 changed files with 254 additions and 175 deletions
11
db/migrate/20150222101847_rename_openid_url.rb
Normal file
11
db/migrate/20150222101847_rename_openid_url.rb
Normal file
|
@ -0,0 +1,11 @@
|
|||
class RenameOpenidUrl < ActiveRecord::Migration
|
||||
def change
|
||||
rename_column :users, :openid_url, :auth_uid
|
||||
add_column :users, :auth_provider, :string
|
||||
|
||||
User.where.not(:auth_uid => nil).update_all(:auth_provider => "openid")
|
||||
|
||||
add_index :users, [:auth_provider, :auth_uid], :unique => true, :name => "users_auth_idx"
|
||||
remove_index :users, :column => :auth_uid, :unique => true, :name => "user_openid_url_idx"
|
||||
end
|
||||
end
|
Loading…
Add table
Add a link
Reference in a new issue