Sha256: 48f20d24e293683a7102c4039395b58580015ee92a33552fa1fb7c2c0e2ffc8d
Contents?: true
Size: 688 Bytes
Versions: 42
Compression:
Stored size: 688 Bytes
Contents
migration <%= migration_number.to_i %>, :<%= migration_file_name %> do up do <% unless attributes.empty? -%> modify_table :<%= table_name %> do <% attributes.each do |attribute| -%> <%= migration_action %>_column :<%= attribute.name %><% if migration_action == 'add' %>, :<%= attribute.type_class %><% end -%> <% end -%> end <% end -%> end down do <% unless attributes.empty? -%> modify_table :<%= table_name %> do <% attributes.reverse.each do |attribute| -%> <%= migration_action == 'add' ? 'drop' : 'add' %>_column :<%= attribute.name %><% if migration_action == 'drop' %>, :<%= attribute.type_class %><% end -%> <% end -%> end <% end -%> end end
Version data entries
42 entries across 42 versions & 2 rubygems