Sha256: ac1dd5ca16919b65205c6e97587b2b0e2112e329c1ad8f0b3784cfb4d9b321f0

Contents?: true

Size: 547 Bytes

Versions: 2

Compression:

Stored size: 547 Bytes

Contents

class <%= class_name.underscore.camelize %> < ActiveGroonga::Migration
  def self.up<% attributes.each do |attribute| %>
    <%= migration_action %>_column :<%= table_name %>, :<%= attribute.name %><% if migration_action == 'add' %>, :<%= attribute.type %><% end -%>
  <%- end %>
  end

  def self.down<% attributes.reverse.each do |attribute| %>
    <%= migration_action == 'add' ? 'remove' : 'add' %>_column :<%= table_name %>, :<%= attribute.name %><% if migration_action == 'remove' %>, :<%= attribute.type %><% end -%>
  <%- end %>
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
activegroonga-0.0.7 rails_generators/migration_groonga/templates/migration.rb
activegroonga-0.0.6 rails_generators/migration_groonga/templates/migration.rb