jgaskins / perpetuity

Persistence gem for Ruby objects using the Data Mapper pattern
http://jgaskins.org/blog/2012/04/20/data-mapper-vs-active-record/
MIT License
250 stars 14 forks source link

Mapper#reindex! should delete unused indexes #25

Closed jgaskins closed 11 years ago

jgaskins commented 11 years ago

Currently, if you specify an index in the mapper DSL and call reindex!, it creates any of those indexes that don't exist in the DB.

reindex! should synchronize the DB with what is currently specified in the mapper DSL. This way, if you redeploy with a removed index DSL call, running reindex! on the mapper would remove that index for real.

Removing indexes (using Mapper#remove_index!) currently seems to be broken (it removes them from the set of indexes, but not from the DB) and I've been beating my head against my desk for hours trying to figure out a good way to fix it.

jgaskins commented 11 years ago

Fixed in 411f91f