Sha256: 7336e14f95ea69cac16ea30b90bbe7fbb30d05a441b6edcf0b75f1012f3fb062

Contents?: true

Size: 487 Bytes

Versions: 48

Compression:

Stored size: 487 Bytes

Contents

# frozen_string_literal: true

class AddFollowableCounterCacheToProposals < ActiveRecord::Migration[5.2]
  def change
    add_column :decidim_proposals_proposals, :follows_count, :integer, null: false, default: 0, index: true

    reversible do |dir|
      dir.up do
        Decidim::Proposals::Proposal.reset_column_information
        Decidim::Proposals::Proposal.find_each do |record|
          record.class.reset_counters(record.id, :follows)
        end
      end
    end
  end
end

Version data entries

48 entries across 48 versions & 1 rubygems

Version Path
decidim-proposals-0.25.0.rc4 db/migrate/20210310102839_add_followable_counter_cache_to_proposals.rb
decidim-proposals-0.25.0.rc3 db/migrate/20210310102839_add_followable_counter_cache_to_proposals.rb
decidim-proposals-0.25.0.rc2 db/migrate/20210310102839_add_followable_counter_cache_to_proposals.rb
decidim-proposals-0.25.0.rc1 db/migrate/20210310102839_add_followable_counter_cache_to_proposals.rb
decidim-proposals-0.24.3 db/migrate/20210310102839_add_followable_counter_cache_to_proposals.rb
decidim-proposals-0.24.2 db/migrate/20210310102839_add_followable_counter_cache_to_proposals.rb
decidim-proposals-0.24.1 db/migrate/20210310102839_add_followable_counter_cache_to_proposals.rb
decidim-proposals-0.24.0 db/migrate/20210310102839_add_followable_counter_cache_to_proposals.rb