Sha256: 72e92fc8dce0ea7f35dcc35eb884ee1016a11ab85fd9848ba56d6b2be3e97664
Contents?: true
Size: 689 Bytes
Versions: 22
Compression:
Stored size: 689 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
22 entries across 22 versions & 3 rubygems