Do `update_category_cache_for_all` in a callback instead of calling it manually everywhere.
rake db:migrate