Sha256: a422a1d6a685503a757e2932cf0deec89f33d60352a7dd2cc30f158329b94526
Contents?: true
Size: 1.68 KB
Versions: 14
Compression:
Stored size: 1.68 KB
Contents
# frozen_string_literal: true class AddDeviseToUsers < ActiveRecord::Migration[4.2] def self.up ## Database authenticatable change_column :users, :email, :string, null: false, default: "" rename_column :users, :password, :encrypted_password change_column :users, :encrypted_password, :string, null: false, default: "" change_table(:users) do |t| ## Recoverable t.string :reset_password_token t.datetime :reset_password_sent_at ## Rememberable t.datetime :remember_created_at ## Trackable t.integer :sign_in_count, default: 0, null: false t.datetime :current_sign_in_at t.datetime :last_sign_in_at t.string :current_sign_in_ip t.string :last_sign_in_ip # Timestamps were not included in our original model. t.timestamps end add_index :users, :email, unique: true add_index :users, :reset_password_token, unique: true end def self.down remove_index :users, :email remove_index :users, :reset_password_token remove_column :users, :created_at remove_column :users, :updated_at remove_column :users, :sign_in_count remove_column :users, :current_sign_in_at remove_column :users, :last_sign_in_at remove_column :users, :current_sign_in_ip remove_column :users, :last_sign_in_ip remove_column :users, :remember_created_at remove_column :users, :reset_password_token remove_column :users, :reset_password_sent_at change_column :users, :encrypted_password, :string, null: true, default: nil rename_column :users, :encrypted_password, :password change_column :users, :email, :text, null: true, default: nil end end
Version data entries
14 entries across 14 versions & 1 rubygems