Sprankelprachtig aan/afmeldsysteem

20170210180426_remove_tokens_from_users.rb 538B

12345678910111213141516171819202122
  1. class RemoveTokensFromUsers < ActiveRecord::Migration[5.0]
  2. def up
  3. remove_column :users, :confirmation_token
  4. remove_column :users, :password_reset_token
  5. create_table :tokens do |t|
  6. t.string :token
  7. t.datetime :expires
  8. t.string :tokentype
  9. t.integer :user_id
  10. t.index ["token"], name: "index_tokens_on_token", unique: true
  11. end
  12. end
  13. def down
  14. add_column :users, :confirmation_token, :string
  15. add_column :users, :password_reset_token, :string
  16. drop_table :tokens
  17. end
  18. end