Sha256: 9415fa2ea1cc6ac137719afadf211e44b8933333714cd8885e4d10d8fe2f4bfe

Contents?: true

Size: 447 Bytes

Versions: 6

Compression:

Stored size: 447 Bytes

Contents

class DeviseTokenAuthAddTokenInfoToUsers < ActiveRecord::Migration
  def change
    change_table(:users) do |t|
      ## unique oauth id
      t.string :provider
      t.string :uid, :null => false, :default => ""

      ## Tokens
      t.text :tokens
    end

    add_index :users, :uid,                  :unique => true

    User.reset_column_information
    User.all.each do |user|
      user.uid = user.login
      user.save
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
xing-backend-1.0.0.pre.beta db/migrate/20140914030703_devise_token_auth_add_token_info_to_users.rb
xing-backend-0.0.25 db/migrate/20140914030703_devise_token_auth_add_token_info_to_users.rb
xing-backend-0.0.23 db/migrate/20140914030703_devise_token_auth_add_token_info_to_users.rb
xing-backend-0.0.22 db/migrate/20140914030703_devise_token_auth_add_token_info_to_users.rb
xing-backend-0.0.21 db/migrate/20140914030703_devise_token_auth_add_token_info_to_users.rb
xing-backend-0.0.20 db/migrate/20140914030703_devise_token_auth_add_token_info_to_users.rb