Sha256: 7c4c62082d2bdffec15f3203167633331322cea009d1c46cc2c5802837ff94f4

Contents?: true

Size: 371 Bytes

Versions: 58

Compression:

Stored size: 371 Bytes

Contents

# frozen_string_literal: true

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

Version data entries

58 entries across 58 versions & 1 rubygems

Version Path
decidim-sortitions-0.29.1 db/migrate/20200827154036_add_commentable_counter_cache_to_sortitions.rb
decidim-sortitions-0.28.4 db/migrate/20200827154036_add_commentable_counter_cache_to_sortitions.rb
decidim-sortitions-0.27.9 db/migrate/20200827154036_add_commentable_counter_cache_to_sortitions.rb
decidim-sortitions-0.29.0 db/migrate/20200827154036_add_commentable_counter_cache_to_sortitions.rb
decidim-sortitions-0.28.3 db/migrate/20200827154036_add_commentable_counter_cache_to_sortitions.rb
decidim-sortitions-0.27.8 db/migrate/20200827154036_add_commentable_counter_cache_to_sortitions.rb
decidim-sortitions-0.29.0.rc4 db/migrate/20200827154036_add_commentable_counter_cache_to_sortitions.rb
decidim-sortitions-0.29.0.rc3 db/migrate/20200827154036_add_commentable_counter_cache_to_sortitions.rb
decidim-sortitions-0.29.0.rc2 db/migrate/20200827154036_add_commentable_counter_cache_to_sortitions.rb
decidim-sortitions-0.29.0.rc1 db/migrate/20200827154036_add_commentable_counter_cache_to_sortitions.rb
decidim-sortitions-0.28.2 db/migrate/20200827154036_add_commentable_counter_cache_to_sortitions.rb
decidim-sortitions-0.27.7 db/migrate/20200827154036_add_commentable_counter_cache_to_sortitions.rb
decidim-sortitions-0.28.1 db/migrate/20200827154036_add_commentable_counter_cache_to_sortitions.rb
decidim-sortitions-0.27.6 db/migrate/20200827154036_add_commentable_counter_cache_to_sortitions.rb
decidim-sortitions-0.26.10 db/migrate/20200827154036_add_commentable_counter_cache_to_sortitions.rb
decidim-sortitions-0.26.9 db/migrate/20200827154036_add_commentable_counter_cache_to_sortitions.rb
decidim-sortitions-0.28.0 db/migrate/20200827154036_add_commentable_counter_cache_to_sortitions.rb
decidim-sortitions-0.27.5 db/migrate/20200827154036_add_commentable_counter_cache_to_sortitions.rb
decidim-sortitions-0.28.0.rc5 db/migrate/20200827154036_add_commentable_counter_cache_to_sortitions.rb
decidim-sortitions-0.28.0.rc4 db/migrate/20200827154036_add_commentable_counter_cache_to_sortitions.rb