I have already created a User Model using devise, but I now want to add support for token_authenticable, so I need to migrate these additions. Is the following correct, and what type should token_authenticatable be?
class AddAuthenticationTokenToUser < ActiveRecord::Migration
def change
add_column :users, :token_authenticatable
add_index :users, :authentication_token, :unique => true
end
end
From the devise 2.0 generator (line 74) on Github:
If you are going to be looking up a user based on their token, then adding an index is a good idea.
Here is the devise 1.5 file