Sha256: f6e03bdca41e512a69c5ff8cde30bab236b9931235766d0c9021ca8367d4594d

Contents?: true

Size: 938 Bytes

Versions: 14

Compression:

Stored size: 938 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 null: false
    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 %>, [:provider, :uid],     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

14 entries across 14 versions & 1 rubygems

Version Path
anadea-identity-0.5.4 lib/generators/identity/templates/migration_existing.rb
anadea-identity-0.5.3 lib/generators/identity/templates/migration_existing.rb
anadea-identity-0.5.2 lib/generators/identity/templates/migration_existing.rb
anadea-identity-0.5.1 lib/generators/identity/templates/migration_existing.rb
anadea-identity-0.5.0 lib/generators/identity/templates/migration_existing.rb
anadea-identity-0.4.2 lib/generators/identity/templates/migration_existing.rb
anadea-identity-0.4.1 lib/generators/identity/templates/migration_existing.rb
anadea-identity-0.4.0 lib/generators/identity/templates/migration_existing.rb
anadea-identity-0.3.3 lib/generators/identity/templates/migration_existing.rb
anadea-identity-0.3.2 lib/generators/identity/templates/migration_existing.rb
anadea-identity-0.3.1 lib/generators/identity/templates/migration_existing.rb
anadea-identity-0.3.0 lib/generators/identity/templates/migration_existing.rb
anadea-identity-0.2.1 lib/generators/identity/templates/migration_existing.rb
anadea-identity-0.2.0 lib/generators/identity/templates/migration_existing.rb