Sha256: 0746eb865a433d2582ab7ff4baf91ce4e4cc132be67bf05f23b562dfff5dcae4

Contents?: true

Size: 409 Bytes

Versions: 2

Compression:

Stored size: 409 Bytes

Contents

class <%= model_class_name %>Migration < ActiveRecord::Migration
  def self.up
    <%= "create_table :#{table_name} do |t|" if table_name %>
<% for attribute in model_attributes -%>
      t.<%= "%-11s" % attribute.last %> :<%= attribute.first %> 
<% end -%>

      t.timestamps
    <%= "end" if table_name %> 
  end

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

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
merb_activerecord-0.9.2 activerecord_generators/migration/templates/schema/migrations/%migration_file_name%.rb
merb_activerecord-0.9.3 activerecord_generators/migration/templates/schema/migrations/%migration_file_name%.rb