Sha256: 75de506ee278ed1c71386602b4574dbf795a704ea4419e0ebd7a6773f0305ce0

Contents?: true

Size: 357 Bytes

Versions: 58

Compression:

Stored size: 357 Bytes

Contents

# frozen_string_literal: true

class AddCommentableCounterCacheToComments < ActiveRecord::Migration[5.2]
  def change
    add_column :decidim_comments_comments, :comments_count, :integer, null: false, default: 0, index: true
    Decidim::Comments::Comment.reset_column_information
    Decidim::Comments::Comment.find_each(&:update_comments_count)
  end
end

Version data entries

58 entries across 58 versions & 1 rubygems

Version Path
decidim-comments-0.25.0.rc4 db/migrate/20200828101910_add_commentable_counter_cache_to_comments.rb
decidim-comments-0.25.0.rc3 db/migrate/20200828101910_add_commentable_counter_cache_to_comments.rb
decidim-comments-0.25.0.rc2 db/migrate/20200828101910_add_commentable_counter_cache_to_comments.rb
decidim-comments-0.25.0.rc1 db/migrate/20200828101910_add_commentable_counter_cache_to_comments.rb
decidim-comments-0.24.3 db/migrate/20200828101910_add_commentable_counter_cache_to_comments.rb
decidim-comments-0.23.6 db/migrate/20200828101910_add_commentable_counter_cache_to_comments.rb
decidim-comments-0.24.2 db/migrate/20200828101910_add_commentable_counter_cache_to_comments.rb
decidim-comments-0.23.5 db/migrate/20200828101910_add_commentable_counter_cache_to_comments.rb
decidim-comments-0.24.1 db/migrate/20200828101910_add_commentable_counter_cache_to_comments.rb
decidim-comments-0.24.0 db/migrate/20200828101910_add_commentable_counter_cache_to_comments.rb
decidim-comments-0.24.0.rc2 db/migrate/20200828101910_add_commentable_counter_cache_to_comments.rb
decidim-comments-0.23.4 db/migrate/20200828101910_add_commentable_counter_cache_to_comments.rb
decidim-comments-0.24.0.rc1 db/migrate/20200828101910_add_commentable_counter_cache_to_comments.rb
decidim-comments-0.23.3 db/migrate/20200828101910_add_commentable_counter_cache_to_comments.rb
decidim-comments-0.23.2 db/migrate/20200828101910_add_commentable_counter_cache_to_comments.rb
decidim-comments-0.23.1 db/migrate/20200828101910_add_commentable_counter_cache_to_comments.rb
decidim-comments-0.23.1.rc1 db/migrate/20200828101910_add_commentable_counter_cache_to_comments.rb
decidim-comments-0.23.0 db/migrate/20200828101910_add_commentable_counter_cache_to_comments.rb