Sha256: 22f81a8edb36bd524dcc80c8943fb65ef7a9ae6f0dfb28c38b024578955db511

Contents?: true

Size: 550 Bytes

Versions: 1

Compression:

Stored size: 550 Bytes

Contents

class <%= migration_name %> < ActiveRecord::Migration
  def self.up
    create_table :<%= table_name %> do |t|
<% for attribute in attributes -%>
      t.<%= attribute.type %> :<%= attribute.name %><%= ", :default => #{attribute.default_value}" if attribute.default %>
<% end -%>
<% unless options[:skip_timestamps] %>
      t.timestamps
<% end -%>

<% for attribute in attributes -%><% if attribute.is_indexed -%>
      add_index :<%= attribute.name %>
<% end -%><% end -%>
    end
  end

  def self.down
    drop_table :<%= table_name %>
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
toastyapps-migratory-0.0.1 generators/model/templates/migration.rb