Sha256: be3ee0266b8e2c2ebddaefedf167deda36d8c0a49cea1882d16a9c38da837490

Contents?: true

Size: 553 Bytes

Versions: 1

Compression:

Stored size: 553 Bytes

Contents

# For details on Sequel migrations see 
# http://sequel.rubyforge.org/
# http://code.google.com/p/ruby-sequel/wiki/Migrations

class <%= model_class_name %>Migration < Sequel::Migration

  def up
    <%= "create_table :#{table_name} do" if table_name %>
<% if model_attributes.empty? -%>
      primary_key :id
<% else -%>
<% model_attributes.each do |attribute| -%>
      <%= attribute.last %> :<%= attribute.first %>
<% end -%>
<% end -%>
    <%= "end" if table_name %>
  end

  def down
    <% "drop_table :#{table_name}" if table_name -%>
  end

end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
merb_sequel-0.9.3 sequel_generators/migration/templates/schema/migrations/%migration_file_name%.rb