fzngagan
(Faizaan Gagan)
July 1, 2020, 8:44am
8
I’m getting the same issue while running migrations with our discourse-ratings plugin alone with a vanilla dev setup. I don’t see any code which specifically asks for cached_version column.
commit hash: 093ee1d80c269afd00ba1341a3e71eb97e4ce7f1
I ran RAILS_ENV=test rake db:drop db:create db:migrate so there should be no data in the db.
This is the line
class AddRatingTypes < ActiveRecord::Migration[6.0]
def up
posts = Post.where("id in (SELECT post_id from post_custom_fields where name = 'rating')")
topics = Topic.where(id: posts.pluck(:topic_id).uniq)
posts.each do |post|
rating = {
type: DiscourseRatings::RatingType::NONE,
value: post.custom_fields["rating"],
weight: post.custom_fields["rating_weight"]
}
DiscourseRatings::Rating.build_and_set(post, rating)
post.save_custom_fields(true)
end
topics.each do |topic|