Specifically, I want to add an spatial index in a multi_polygon column. This works nicely in PostgreSQL but not in MySQL, so I was thinking of somthing like:
create_table :figures do |t|
t.multi_polygon :polygon
end
add_index :figures, :polygon if database_adapter == :postgresql
Is it possible and a good idea?
You can pass index this way
add_index(:figures, [:polygon,:extra1,:extra2], :name => ‘fig_poly’)
This will work on mysql,postgresql,oracle and db2.