闭社主体 forked from https://github.com/tootsuite/mastodon
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

38 lines
1.1 KiB

  1. class AddDeviseToUsers < ActiveRecord::Migration
  2. def self.up
  3. change_table(:users) do |t|
  4. ## Database authenticatable
  5. t.string :encrypted_password, null: false, default: ""
  6. ## Recoverable
  7. t.string :reset_password_token
  8. t.datetime :reset_password_sent_at
  9. ## Rememberable
  10. t.datetime :remember_created_at
  11. ## Trackable
  12. t.integer :sign_in_count, default: 0, null: false
  13. t.datetime :current_sign_in_at
  14. t.datetime :last_sign_in_at
  15. t.inet :current_sign_in_ip
  16. t.inet :last_sign_in_ip
  17. end
  18. add_index :users, :reset_password_token, unique: true
  19. end
  20. def self.down
  21. remove_index :users, :reset_password_token
  22. remove_column :users, :encrypted_password
  23. remove_column :users, :reset_password_token
  24. remove_column :users, :reset_password_sent_at
  25. remove_column :users, :remember_created_at
  26. remove_column :users, :sign_in_count
  27. remove_column :users, :current_sign_in_at
  28. remove_column :users, :current_sign_in_ip
  29. remove_column :users, :last_sign_in_at
  30. remove_column :users, :last_sign_in_ip
  31. end
  32. end