Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

tried to get the options right - but seems not to work

  • Loading branch information...
commit 3a024e63d303ae3dc8e37d270a2c46df1ca5a94b 1 parent 6c4e37b
Christian Meier authored
Showing with 4 additions and 3 deletions.
  1. +4 −3 generators/datamapper_model/templates/migration.rb
7 generators/datamapper_model/templates/migration.rb
View
@@ -1,12 +1,13 @@
migration <%= Time.now.utc.strftime("%Y%m%d%H%M%S") %>, :<%= migration_name.underscore %> do
up do
create_table :<%= table_name %> do
+ column :id, Integer, :serial => true
<% 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 -%>
<% unless options[:skip_timestamps] -%>
- column :created_at, DateTime, :nullable? => false
- column :updated_at, DateTime, :nullable? => false
+ column :created_at, DateTime, :nullable => false
+ column :updated_at, DateTime, :nullable => false
<% end -%>
end
end
Please sign in to comment.
Something went wrong with that request. Please try again.