engageis/activerecord-postgres-hstore — pull request #58 by virtualstaticvoid (2012-12-07 08:33:19+00:00)
Title: Migration helper functions

Provides support to migrations by adding the following methods:

* `install_hstore` - creates the hstore extension
* `uninstall_hstore` - drops the hstore extension
* `add_hstore_index` - creates a `:gist` or `:gin` index for an hstore column
* `remove_hstore_index` - drops a `:gist` or `:gin` index on an hstore column

Example schema migration for a products table to add an hstore index:

```ruby
class AddHstoreIndexToProducts < ActiveRecord::Migration
def up
add_hstore_index :products, :hstore_data, :type => :gin
end

def down
remove_hstore_index :products, :hstore_data
end
end
```