Closed gravis closed 14 years ago
Give this a try:
acts_as_archive :indexes => [ :user_id, :model_id, :model_type ]
I get (of course) : ... "index_archived_users_on_model_id" btree (model_id) "index_archived_users_on_model_type" btree (model_type)
not an index on (model_id, model_type). It's really not the same :(
Ah, I see, unfortunately that's not currently supported. Looks like you'll have to add them manually via migration. If you want to add some code I would be happy to pull your changes :).
Ok Winton, I will, but I need a few days to submit a patch (/pull request). Maybe this week-end ! I'll keep this ticket updated. Thanks
sorry, but why is this ticket closed ?
Sorry, I closed it upon posting my comment, sort of as a "wontfix". Please feel free to continue updating it and I will pull your changes as soon as you're ready.
Thanks :) We found another bug, I'll file a ticket and try to fix it asap
acts_as_archive :indexes => [ user_id, [:model_id, :model_type]]
is now supported on pgsql : http://github.com/gravis/acts_as_archive/commit/1d4fc6f05261d348f49f2d4a32642d7e274896b4 Anyway, I'm not a MySQL expert, it will certainly break something (I don't have mysql to test), but I'm sure you will be able to fix them easily ;)
Thanks
MySQL was a bit of pain to support, but here it is : http://github.com/gravis/acts_as_archive/commit/b93e035dcb5e3a4ea07ebfd87937e8001eb8e41b
Hi,
I've noticed indexes for "polymorphic" columns are failing :
I should have an index on user_id and model_id+model_type, instead I get an error : ActiveRecord::StatementInvalid: PGError: ERROR: column "model_idmodel_type" does not exist