Support Geography datatype and spatial index
There is a datatype called geography that is a binary representation of spatial data. I found that when I tried leveraging this in Rails, it was mapped to string in the schema dump. This will cause inconsistency with schema loading in tasks like db:prepare.
Additionally, Spatial Indexes allow performance querying against the geography datatype by organizing the information into quadrants. They are handled separately from traditional data indexes.
We can create them using the type: option with
add_index :zip_codes, :geography_point, type: :spatial
But they do not get listed in the schema dump, and they cannot be found for reversal without specifying by name.
Updated the issue to reflect that spatial index creation is already available using the type option, i.e.
add_index :zip_codes, :geography_point, type: :spatial
But, the spatial index isn't added to schema.rb, and remove_index does not work without specifying :name. It seems to be related to the fact that spatial indices are not included in the #indexes method, which uses sp_helpindex sproc.
So, if this gets picked up, we should be sure to check for index reversal for type: :spatial.