ryanto/acts_as_votable

Migration to add cache fails

Closed this issue · 0 comments

edited:
Please disregard this issue. It was caused by some legacy code in my project, not the gem.

Migration to add cache columns fails, and my guess is that it has to do with capistrano authorization or memory consumption.

So this is what I have done:
I've added cache columns to several models in my application, and added Post.find_each(&:update_cached_votes) at the end of migration files as you have suggested.

Both migration and cache columns worked fine in the local environment.

I tried capping them to the staging environment, then they started going nuts.
cap and migration would succeed until adding index part, then fail at the updating cached votes part.

I removed updating part and cap succeeds without an issue.

I brought up rails console in the staging server, then manually ran those commands.

On models with less than 1,000 records, the update commands worked fine.
I executed update commands on models with 13,000 records and 50,000 records respectively,
then rails console throws errors and crashes.