Skip to content

Instantly share code, notes, and snippets.

@scaffeinate
Last active August 29, 2015 14:24
Show Gist options
  • Select an option

  • Save scaffeinate/8ef26db3e1d682ee3e5e to your computer and use it in GitHub Desktop.

Select an option

Save scaffeinate/8ef26db3e1d682ee3e5e to your computer and use it in GitHub Desktop.
Devise user migration - socify
class DeviseCreateUsers < ActiveRecord::Migration
def change
create_table(:users) do |t|
t.string :name, null: false, default: ""
t.string :email, null: false, default: ""
t.string :encrypted_password, null: false, default: ""
t.string :about
t.string :avatar
t.string :cover
t.string :reset_password_token
t.datetime :reset_password_sent_at
t.datetime :remember_created_at
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
t.string :confirmation_token
t.datetime :confirmed_at
t.datetime :confirmation_sent_at
t.timestamps null: false
end
add_index :users, :email, unique: true
add_index :users, :reset_password_token, unique: true
add_index :users, :confirmation_token, unique: true
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment