Sha256: 4fcec823c740a2b51d6b8cdc51abfae677b7eebe62dc9ad25fb078190b3e2879

Contents?: true

Size: 923 Bytes

Versions: 4

Compression:

Stored size: 923 Bytes

Contents

class DeviseCreate<%= table_name.camelize %> < ActiveRecord::Migration
  def self.up
    create_table(:<%= table_name %>) do |t|
      t.database_authenticatable :null => false
      t.recoverable
      t.rememberable
      t.trackable

      # t.encryptable
      # t.confirmable
      # t.lockable :lock_strategy => :<%= Devise.lock_strategy %>, :unlock_strategy => :<%= Devise.unlock_strategy %>
      # t.token_authenticatable

<% for attribute in attributes -%>
      t.<%= attribute.type %> :<%= attribute.name %>
<% end -%>

      t.timestamps
    end

    add_index :<%= table_name %>, :email,                :unique => true
    add_index :<%= table_name %>, :reset_password_token, :unique => true
    # add_index :<%= table_name %>, :confirmation_token,   :unique => true
    # add_index :<%= table_name %>, :unlock_token,         :unique => true
  end

  def self.down
    drop_table :<%= table_name %>
  end
end

Version data entries

4 entries across 4 versions & 4 rubygems

Version Path
devise-1.2.rc lib/generators/active_record/templates/migration.rb
aihs_devise-1.2.rc lib/generators/active_record/templates/migration.rb
gonow-devise-1.2.rc lib/generators/active_record/templates/migration.rb
devise-edge-1.2.rc lib/generators/active_record/templates/migration.rb