Sha256: 02d52d35f041dd601aeed37c6bc7f0c4b98922a01333077527313c22295184fc

Contents?: true

Size: 864 Bytes

Versions: 7

Compression:

Stored size: 864 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 == :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 -%>
<% unless options[:skip_modified_by] -%>
      column :created_by_id, Integer, :nullable => false
      column :updated_by_id, Integer, :nullable => false
<% end -%>
    end
  end

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

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
ixtlan-0.4.3 generators/ixtlan_datamapper_model/templates/migration.rb
ixtlan-0.4.2 generators/ixtlan_datamapper_model/templates/migration.rb
ixtlan-0.4.1 generators/ixtlan_datamapper_model/templates/migration.rb
ixtlan-0.4.0 generators/ixtlan_datamapper_model/templates/migration.rb
ixtlan-0.4.0.pre5 generators/ixtlan_datamapper_model/templates/migration.rb
ixtlan-0.4.0.pre4 generators/ixtlan_datamapper_model/templates/migration.rb
ixtlan-0.4.0.pre3 generators/ixtlan_datamapper_model/templates/migration.rb