Sha256: e807fc81e140655e1eb0042b4769e9cc4305fa7f15dbf020e287d68e5accd315

Contents?: true

Size: 659 Bytes

Versions: 14

Compression:

Stored size: 659 Bytes

Contents

class Create<%= class_name.pluralize %> < ActiveRecord::Migration[5.0]
    def change
        create_table :<%= table_name %> do |t|
<% fields.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
<% fields_with_index.each do |attribute| -%>
        add_index :<%= table_name %>, :<%= attribute.index_name %><%= attribute.inject_index_options %>
<% end -%>
    end
end

Version data entries

14 entries across 14 versions & 2 rubygems

Version Path
hippo-fw-0.9.9 templates/db/create_table_migration.rb
hippo-fw-0.9.8 templates/db/create_table_migration.rb
hippo-fw-0.9.7 templates/db/create_table_migration.rb
hippo-fw-0.9.6 templates/db/create_table_migration.rb
hippo-fw-0.9.5 templates/db/create_table_migration.rb
hippo-fw-0.9.4 templates/db/create_table_migration.rb
hippo-fw-0.9.3 templates/db/create_table_migration.rb
hippo-fw-0.9.2 templates/db/create_table_migration.rb
hippo-fw-0.9.1 templates/db/create_table_migration.rb
lanes-0.8.3 templates/db/create_table_migration.rb
lanes-0.8.2 templates/db/create_table_migration.rb
lanes-0.8.1 templates/db/create_table_migration.rb
lanes-0.8.0 templates/db/create_table_migration.rb
lanes-0.7.0 templates/db/create_table_migration.rb