Last active
December 17, 2015 03:19
-
-
Save traviskroberts/31d302f03da8816c2f9b to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class AddSingleAccessTokenToUser < ActiveRecord::Migration | |
def up | |
add_column :users, :single_access_token, :string | |
# need to set a value so we can update the column to :null => false | |
User.reset_column_information | |
User.all.each { |u| u.reset_single_access_token! } | |
change_column :users, :single_access_token, :string, :null => false | |
end | |
def down | |
remove_column :users, :single_access_token | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment