lib/active_groonga/schema.rb in activegroonga-0.0.6 vs lib/active_groonga/schema.rb in activegroonga-0.0.7

- old
+ new

@@ -44,12 +44,11 @@ inserted = Set.new (versions - migrated).each do |v| if inserted.include?(v) raise "Duplicate migration #{v}. Please renumber your migrations to resolve the conflict." elsif v < version - migration = migrations_table.add - migration["version"] = v.to_s + migration = migrations_table.add(v.to_s) inserted << v end end end @@ -81,9 +80,14 @@ table.column(column_name, type, options) end end def remove_column(table_name, *column_names) + if column_names.last.is_a?(Hash) + options = columns.pop + else + options = {} + end options_with_context = options.merge(:context => Base.context) Groonga::Schema.change_table(table_name, options_with_context) do |table| column_names.each do |column_name| table.remove_column(column_name) end