delay the removal of auth token column from user table

This commit is contained in:
Sam
2017-02-07 09:39:41 -05:00
parent 634755113a
commit 4d57c95e9b
2 changed files with 5 additions and 7 deletions

View File

@ -1,7 +1,5 @@
class AddUserAuthTokens < ActiveRecord::Migration
def down
add_column :users, :auth_token, :string
add_column :users, :auth_token_updated_at, :datetime
execute <<SQL
UPDATE users
SET auth_token = user_auth_tokens.auth_token,
@ -36,8 +34,5 @@ SQL
FROM users
WHERE auth_token_updated_at IS NOT NULL AND auth_token IS NOT NULL
SQL
remove_column :users, :auth_token
remove_column :users, :auth_token_updated_at
end
end