Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Fetching contributors…

Cannot retrieve contributors at this time

32 lines (26 sloc) 1.261 kB
class ChangeToDeviseUsersTable < ActiveRecord::Migration
def self.up
add_column ::User.table_name, :current_sign_in_at, :datetime
add_column ::User.table_name, :last_sign_in_at, :datetime
add_column ::User.table_name, :current_sign_in_ip, :string
add_column ::User.table_name, :last_sign_in_ip, :string
add_column ::User.table_name, :sign_in_count, :integer
add_column ::User.table_name, :remember_token, :string
add_column ::User.table_name, :reset_password_token, :string
rename_column ::User.table_name, :crypted_password, :encrypted_password
rename_column ::User.table_name, :login, :username
::User.reset_column_information
end
def self.down
remove_column ::User.table_name, :current_sign_in_at
remove_column ::User.table_name, :last_sign_in_at
remove_column ::User.table_name, :current_sign_in_ip
remove_column ::User.table_name, :last_sign_in_ip
remove_column ::User.table_name, :sign_in_count
remove_column ::User.table_name, :remember_token
remove_column ::User.table_name, :reset_password_token
rename_column ::User.table_name, :encrypted_password, :crypted_password
rename_column ::User.table_name, :username, :login
::User.reset_column_information
end
end
Jump to Line
Something went wrong with that request. Please try again.