instiki/vendor/rails/railties/lib/rails_generator/generators/components/model/templates/migration.rb

17 lines
354 B
Ruby
Raw Normal View History

2007-01-22 14:43:50 +01:00
class <%= migration_name %> < ActiveRecord::Migration
def self.up
create_table :<%= table_name %> do |t|
<% for attribute in attributes -%>
t.<%= attribute.type %> :<%= attribute.name %>
<% end -%>
<% unless options[:skip_timestamps] %>
t.timestamps
<% end -%>
2007-01-22 14:43:50 +01:00
end
end
def self.down
drop_table :<%= table_name %>
end
end