activerecord-postgres-hstore icon indicating copy to clipboard operation
activerecord-postgres-hstore copied to clipboard

hstore indexes not saved to schema.rb correctly.

Open urkle opened this issue 11 years ago • 5 comments

The hstore indexes are not saved to schema.rb correctly..

instead of saving an add_hstore_index line it simply creates an add_index line, thus the 'gin' index isn't created.

A related issue is that the add_hstore_index :table, :column, :type => :gin doesn't work. (the AR method add_index_options doesn't support a :type option, only :name and :unique).

We are running Rails 3.2.x (going to 4.0 right now isn't an option.. though it's on our roadmap)

urkle avatar Feb 18 '14 16:02 urkle

You could work around using an SQL schema for now. If yu want to keep the schema.rb you can check this gem (which adds the index kind feature): https://github.com/lomba/schema_plus.

diogob avatar Feb 18 '14 16:02 diogob

Is this something that can be easily added to this gem? Or does it require monkey'ing w/ the core ActiveRecord?

urkle avatar Feb 18 '14 16:02 urkle

I'm not sure, I suppose it does need monkey patching though.

diogob avatar Feb 18 '14 16:02 diogob

I'm looking at the schema_plus.. it looks interesting..

urkle avatar Feb 18 '14 17:02 urkle

(I could maybe sneak in some views and SPs to make reporting easier.. WOOT!)

urkle avatar Feb 18 '14 17:02 urkle