Skip to content

Instantly share code, notes, and snippets.

@yamaaki
Created August 11, 2015 08:03
Show Gist options
  • Select an option

  • Save yamaaki/5f925b8c0a3e7121649f to your computer and use it in GitHub Desktop.

Select an option

Save yamaaki/5f925b8c0a3e7121649f to your computer and use it in GitHub Desktop.
class DeviseCreateAdmins < ActiveRecord::Migration
def change
create_table(:admins) do |t|
# Database authenticatable
t.string :email, null: false, default: ""
t.string :encrypted_password, null: false, default: ""
# 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
t.timestamps null: false
end
add_index :admins, :email, unique: true
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment