Sha256: e84bf0cd15f0ba4500769639e2fb3f0cd8da1619a10739c606a4df8e1d228a1d

Contents?: true

Size: 340 Bytes

Versions: 58

Compression:

Stored size: 340 Bytes

Contents

# frozen_string_literal: true

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

Version data entries

58 entries across 58 versions & 1 rubygems

Version Path
decidim-initiatives-0.26.8 db/migrate/20200827154214_add_commentable_counter_cache_to_initiatives.rb
decidim-initiatives-0.27.4 db/migrate/20200827154214_add_commentable_counter_cache_to_initiatives.rb
decidim-initiatives-0.27.3 db/migrate/20200827154214_add_commentable_counter_cache_to_initiatives.rb
decidim-initiatives-0.26.7 db/migrate/20200827154214_add_commentable_counter_cache_to_initiatives.rb
decidim-initiatives-0.26.5 db/migrate/20200827154214_add_commentable_counter_cache_to_initiatives.rb
decidim-initiatives-0.27.2 db/migrate/20200827154214_add_commentable_counter_cache_to_initiatives.rb
decidim-initiatives-0.27.1 db/migrate/20200827154214_add_commentable_counter_cache_to_initiatives.rb
decidim-initiatives-0.26.4 db/migrate/20200827154214_add_commentable_counter_cache_to_initiatives.rb
decidim-initiatives-0.27.0 db/migrate/20200827154214_add_commentable_counter_cache_to_initiatives.rb
decidim-initiatives-0.26.3 db/migrate/20200827154214_add_commentable_counter_cache_to_initiatives.rb
decidim-initiatives-0.27.0.rc2 db/migrate/20200827154214_add_commentable_counter_cache_to_initiatives.rb
decidim-initiatives-0.27.0.rc1 db/migrate/20200827154214_add_commentable_counter_cache_to_initiatives.rb
decidim-initiatives-0.26.2 db/migrate/20200827154214_add_commentable_counter_cache_to_initiatives.rb
decidim-initiatives-0.26.1 db/migrate/20200827154214_add_commentable_counter_cache_to_initiatives.rb
decidim-initiatives-0.26.0 db/migrate/20200827154214_add_commentable_counter_cache_to_initiatives.rb
decidim-initiatives-0.26.0.rc2 db/migrate/20200827154214_add_commentable_counter_cache_to_initiatives.rb
decidim-initiatives-0.26.0.rc1 db/migrate/20200827154214_add_commentable_counter_cache_to_initiatives.rb
decidim-initiatives-0.25.2 db/migrate/20200827154214_add_commentable_counter_cache_to_initiatives.rb
decidim-initiatives-0.25.1 db/migrate/20200827154214_add_commentable_counter_cache_to_initiatives.rb
decidim-initiatives-0.25.0 db/migrate/20200827154214_add_commentable_counter_cache_to_initiatives.rb