Sha256: 54acb88f35894d841c58d957d022de992458c2be2c08b76a412bf376a8dfdc7e

Contents?: true

Size: 636 Bytes

Versions: 4

Compression:

Stored size: 636 Bytes

Contents

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<% if attribute.type == :string %>, :length => 255<% end %>
<% end -%>
<% unless options[:skip_timestamps] -%>
      column :created_at, DateTime, :nullable => false
      column :updated_at, DateTime, :nullable => false
<% end -%>
    end
  end

  down do
    drop_table :<%= table_name %>
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
datamapper4rails-0.4.0 generators/datamapper_model/templates/migration.rb
datamapper4rails-0.3.2 generators/datamapper_model/templates/migration.rb
datamapper4rails-0.3.1 generators/datamapper_model/templates/migration.rb
datamapper4rails-0.3.0 generators/datamapper_model/templates/migration.rb