Sha256: 61ce8d54e10a50e1cab03605d0e7905d82a2cca490b3682912f30b2942e9f942
Contents?: true
Size: 575 Bytes
Versions: 1
Compression:
Stored size: 575 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 <% if table_name -%> execute "DROP TABLE <%= table_name %>" <% end -%> end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
merb_sequel-0.9.2 | sequel_generators/migration/templates/schema/migrations/%migration_file_name%.rb |