Sha256: ce304ce4ade36bdcdc84bfecdbf9d38ba3f023f5d4b5a74390bcdeccdb7cdd28

Contents?: true

Size: 1019 Bytes

Versions: 55

Compression:

Stored size: 1019 Bytes

Contents

class AddDeviseTo<%= table_name.camelize %> < ActiveRecord::Migration
  def self.up
    change_table(:<%= table_name %>) do |t|
<%= migration_data -%>

<% attributes.each do |attribute| -%>
      t.<%= attribute.type %> :<%= attribute.name %>
<% end -%>

      # Uncomment below if timestamps were not included in your original model.
      # 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

  def self.down
    # By default, we don't want to make any assumption about how to roll back a migration when your
    # model already existed. Please edit below which fields you would like to remove in this migration.
    raise ActiveRecord::IrreversibleMigration
  end
end

Version data entries

55 entries across 50 versions & 8 rubygems

Version Path
devise-3.0.4 lib/generators/active_record/templates/migration_existing.rb
devise-2.2.8 lib/generators/active_record/templates/migration_existing.rb
loyal_devise-2.2.6 lib/generators/active_record/templates/migration_existing.rb
devise-2.0.6 lib/generators/active_record/templates/migration_existing.rb
devise-2.1.4 lib/generators/active_record/templates/migration_existing.rb
devise-2.2.7 lib/generators/active_record/templates/migration_existing.rb
devise-3.0.3 lib/generators/active_record/templates/migration_existing.rb
devise-3.1.0.rc2 lib/generators/active_record/templates/migration_existing.rb
loyal_devise-2.2.5 lib/generators/active_record/templates/migration_existing.rb
devise-2.2.6 lib/generators/active_record/templates/migration_existing.rb
devise-3.0.2 lib/generators/active_record/templates/migration_existing.rb
devise-3.0.1 lib/generators/active_record/templates/migration_existing.rb
devise-2.2.5 lib/generators/active_record/templates/migration_existing.rb
loyal_devise-2.1.10 lib/generators/active_record/templates/migration_existing.rb
loyal_devise-2.1.7 lib/generators/active_record/templates/migration_existing.rb
loyal_devise-2.1.6 lib/generators/active_record/templates/migration_existing.rb
devise-3.0.0 lib/generators/active_record/templates/migration_existing.rb
loyal_devise-2.1.5 lib/generators/active_record/templates/migration_existing.rb
loyal_devise-2.1.4 lib/generators/active_record/templates/migration_existing.rb
loyal_devise-2.1.3 lib/generators/active_record/templates/migration_existing.rb