Sha256: 816bbc127a479c0d2ca3ac776257740ec43536377283ff7f1f067a554384c284

Contents?: true

Size: 915 Bytes

Versions: 2

Compression:

Stored size: 915 Bytes

Contents

class DeviseCreate<%= table_name.camelize %> < ActiveRecord::Migration
<% if ::Rails::VERSION::MAJOR == 3 && ::Rails::VERSION::MINOR >= 1 -%>
  def change
<% else -%>
  def self.up
<% end -%>
    create_table(:<%= table_name %>) do |t|
<%= migration_data -%>

<% attributes.each do |attribute| -%>
      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
    # add_index :<%= table_name %>, :authentication_token, :unique => true
  end

<% unless ::Rails::VERSION::MAJOR == 3 && ::Rails::VERSION::MINOR >= 1 -%>
  def self.down
    drop_table :<%= table_name %>
  end
<% end -%>
end

Version data entries

2 entries across 2 versions & 2 rubygems

Version Path
devise-2.0.0.rc lib/generators/active_record/templates/migration.rb
cloudfoundry-devise-1.5.2 lib/generators/active_record/templates/migration.rb