Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

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

  • Loading branch information...
commit 3a024e63d303ae3dc8e37d270a2c46df1ca5a94b 1 parent 6c4e37b
Christian Meier authored
7  generators/datamapper_model/templates/migration.rb
... ...
@@ -1,12 +1,13 @@
1 1
 migration <%= Time.now.utc.strftime("%Y%m%d%H%M%S") %>, :<%= migration_name.underscore %> do
2 2
   up do
3 3
     create_table :<%= table_name %> do
  4
+      column :id, Integer, :serial => true
4 5
 <% Array(attributes).each do |attribute| -%>
5  
-      column :<%= attribute.name if attribute %>, <%= attribute.type.to_s.capitalize %>, :nullable? => false
  6
+      column :<%= attribute.name if attribute %>, <%= attribute.type.to_s.capitalize %>, :nullable => false<% if attribute.type == :string %>, :length => 255<% end %>
6 7
 <% end -%>
7 8
 <% unless options[:skip_timestamps] -%>
8  
-      column :created_at, DateTime, :nullable? => false
9  
-      column :updated_at, DateTime, :nullable? => false
  9
+      column :created_at, DateTime, :nullable => false
  10
+      column :updated_at, DateTime, :nullable => false
10 11
 <% end -%>
11 12
     end
12 13
   end

0 notes on commit 3a024e6

Please sign in to comment.
Something went wrong with that request. Please try again.