Skip to content

Commit

Permalink
tried to get the options right - but seems not to work
Browse files Browse the repository at this point in the history
  • Loading branch information
mkristian committed Oct 1, 2009
1 parent 6c4e37b commit 3a024e6
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions generators/datamapper_model/templates/migration.rb
@@ -1,12 +1,13 @@
migration <%= Time.now.utc.strftime("%Y%m%d%H%M%S") %>, :<%= migration_name.underscore %> do migration <%= Time.now.utc.strftime("%Y%m%d%H%M%S") %>, :<%= migration_name.underscore %> do
up do up do
create_table :<%= table_name %> do create_table :<%= table_name %> do
column :id, Integer, :serial => true
<% Array(attributes).each do |attribute| -%> <% Array(attributes).each do |attribute| -%>
column :<%= attribute.name if attribute %>, <%= attribute.type.to_s.capitalize %>, :nullable? => false column :<%= attribute.name if attribute %>, <%= attribute.type.to_s.capitalize %>, :nullable => false<% if attribute.type == :string %>, :length => 255<% end %>
<% end -%> <% end -%>
<% unless options[:skip_timestamps] -%> <% unless options[:skip_timestamps] -%>
column :created_at, DateTime, :nullable? => false column :created_at, DateTime, :nullable => false
column :updated_at, DateTime, :nullable? => false column :updated_at, DateTime, :nullable => false
<% end -%> <% end -%>
end end
end end
Expand Down

0 comments on commit 3a024e6

Please sign in to comment.