Sha256: d7d3c0ddcb9d57d8814f2f7d0bb342b832911566db297919e5154a91c972fc49

Contents?: true

Size: 487 Bytes

Versions: 182

Compression:

Stored size: 487 Bytes

Contents

class <%= migration_class_name %> < ActiveRecord::Migration
  def change
    create_table :<%= table_name %> do |t|
<% attributes.each do |attribute| -%>
      t.<%= attribute.type %> :<%= attribute.name %><%= attribute.inject_options %>
<% end -%>
<% if options[:timestamps] %>
      t.timestamps
<% 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

182 entries across 151 versions & 16 rubygems

Version Path
mdg-1.0.1 vendor/bundle/ruby/2.3.0/gems/activerecord-3.2.22.5/lib/rails/generators/active_record/model/templates/migration.rb
activerecord-3.2.22.5 lib/rails/generators/active_record/model/templates/migration.rb
activerecord-3.2.22.4 lib/rails/generators/active_record/model/templates/migration.rb
activerecord-3.2.22.3 lib/rails/generators/active_record/model/templates/migration.rb
activerecord-3.2.22.2 lib/rails/generators/active_record/model/templates/migration.rb
activerecord-3.2.22.1 lib/rails/generators/active_record/model/templates/migration.rb
active_mailer-0.0.10 test/fixtures/dummyapp_rails_3.2/vendor/bundle/ruby/1.9.1/gems/activerecord-3.2.12/lib/rails/generators/active_record/model/templates/migration.rb
activerecord-3.2.22 lib/rails/generators/active_record/model/templates/migration.rb
ez-1.3.0 lib/generators/ez/resource/templates/migration.rb
ez-1.2.0 lib/generators/ez/resource/templates/migration.rb
judge-2.0.5 vendor/bundle/ruby/2.1.0/gems/activerecord-3.2.12/lib/rails/generators/active_record/model/templates/migration.rb
activerecord-3.2.21 lib/rails/generators/active_record/model/templates/migration.rb
apl-library-0.0.90 vendor/bundle/ruby/1.8/gems/activerecord-3.2.18/lib/rails/generators/active_record/model/templates/migration.rb
apl-library-0.0.90 vendor/bundle/ruby/2.1.0/gems/apl-library-0.0.90/vendor/bundle/ruby/1.8/gems/activerecord-3.2.18/lib/rails/generators/active_record/model/templates/migration.rb
apl-library-0.0.90 vendor/bundle/ruby/2.1.0/gems/apl-library-0.0.90/vendor/bundle/ruby/1.9.1/gems/activerecord-3.2.18/lib/rails/generators/active_record/model/templates/migration.rb
apl-library-0.0.90 vendor/bundle/ruby/2.1.0/gems/apl-library-0.0.90/vendor/bundle/ruby/2.1.0/gems/activerecord-3.2.18/lib/rails/generators/active_record/model/templates/migration.rb
apl-library-0.0.90 vendor/bundle/ruby/1.9.1/gems/activerecord-3.2.18/lib/rails/generators/active_record/model/templates/migration.rb
apl-library-0.0.90 vendor/bundle/ruby/2.1.0/gems/activerecord-3.2.18/lib/rails/generators/active_record/model/templates/migration.rb
ez-1.1.3 lib/generators/ez/resource/templates/migration.rb
ez-1.1.2 lib/generators/ez/resource/templates/migration.rb