Sha256: 65707a2c108a1c0eef4214ca9c5ce1e56205769ae583ea3ca89441244c351ae9

Contents?: true

Size: 622 Bytes

Versions: 48

Compression:

Stored size: 622 Bytes

Contents

class <%= migration_class_name %> < ActiveRecord::Migration
  def change
    create_table :<%= table_name %> do |t|
<% attributes.each do |attribute| -%>
<% if attribute.password_digest? -%>
      t.string :password_digest<%= attribute.inject_options %>
<% else -%>
      t.<%= attribute.type %> :<%= attribute.name %><%= attribute.inject_options %>
<% end -%>
<% end -%>
<% if options[:timestamps] %>
      t.timestamps null: false
<% end -%>
    end
<% attributes_with_index.each do |attribute| -%>
    add_index :<%= table_name %>, :<%= attribute.index_name %><%= attribute.inject_index_options %>
<% end -%>
  end
end

Version data entries

48 entries across 47 versions & 8 rubygems

Version Path
activerecord-4.2.5.1 lib/rails/generators/active_record/migration/templates/create_table_migration.rb
angular-rails4-templates-0.4.1 vendor/ruby/2.1.0/gems/activerecord-4.2.4/lib/rails/generators/active_record/migration/templates/create_table_migration.rb
angular-rails4-templates-0.4.0 vendor/ruby/2.1.0/gems/activerecord-4.2.4/lib/rails/generators/active_record/migration/templates/create_table_migration.rb
angular-rails4-templates-0.3.0 vendor/ruby/2.1.0/gems/activerecord-4.2.4/lib/rails/generators/active_record/migration/templates/create_table_migration.rb
activerecord-4.2.5 lib/rails/generators/active_record/migration/templates/create_table_migration.rb
activerecord-4.2.5.rc2 lib/rails/generators/active_record/migration/templates/create_table_migration.rb
activerecord-4.2.5.rc1 lib/rails/generators/active_record/migration/templates/create_table_migration.rb
sc_core-0.0.7 test/dummy/vendor/bundle/ruby/2.2.0/gems/activerecord-4.2.4/lib/rails/generators/active_record/migration/templates/create_table_migration.rb
activerecord-4.2.4 lib/rails/generators/active_record/migration/templates/create_table_migration.rb
activerecord-4.2.4.rc1 lib/rails/generators/active_record/migration/templates/create_table_migration.rb
solidus_backend-1.0.0.pre3 vendor/bundle/gems/activerecord-4.2.3/lib/rails/generators/active_record/migration/templates/create_table_migration.rb
solidus_backend-1.0.0.pre2 vendor/bundle/gems/activerecord-4.2.3/lib/rails/generators/active_record/migration/templates/create_table_migration.rb
solidus_backend-1.0.0.pre vendor/bundle/gems/activerecord-4.2.1/lib/rails/generators/active_record/migration/templates/create_table_migration.rb
solidus_backend-1.0.0.pre vendor/bundle/gems/activerecord-4.2.2/lib/rails/generators/active_record/migration/templates/create_table_migration.rb
activerecord-4.2.3 lib/rails/generators/active_record/migration/templates/create_table_migration.rb
activerecord-4.2.3.rc1 lib/rails/generators/active_record/migration/templates/create_table_migration.rb
activerecord-4.2.2 lib/rails/generators/active_record/migration/templates/create_table_migration.rb
shoppe-paypal-1.1.0 vendor/bundle/ruby/2.1.0/gems/activerecord-4.2.1/lib/rails/generators/active_record/migration/templates/create_table_migration.rb
activerecord-4.2.1 lib/rails/generators/active_record/migration/templates/create_table_migration.rb
activerecord-4.2.1.rc4 lib/rails/generators/active_record/migration/templates/create_table_migration.rb