Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
tree: 9bec2d5993
Fetching contributors…

Octocat-spinner-32-eaf2f5

Cannot retrieve contributors at this time

file 19 lines (17 sloc) 0.698 kb
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
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 == :boolean ? "::DataMapper::Types::Boolean" : 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
Something went wrong with that request. Please try again.