Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Rails 4 pgsql add_index with type GIN or GiST

In Rails it is possible to do:

add_index :table, :column_name, :using => 'btree'

Is it possible in Rails 4 with PGSQL to add a GIN or GiST index like:

add_index :students, :name, :using => 'gin'

Or do I have use manual execute statements? The notion behind this is I would like to keep schema.rb instead of using structure.sql

like image 419
Bill Avatar asked Sep 10 '13 17:09

Bill


1 Answers

In Rails 4, you can now do something like this in a migration:

add_index :products, :data, using: :gin 
like image 159
Pronix Avatar answered Sep 18 '22 12:09

Pronix