Sha256: 7c25010f529931a9e5b9d5a944bf44714e9f7ddd25e016dd24641bdd368fa118

Contents?: true

Size: 506 Bytes

Versions: 48

Compression:

Stored size: 506 Bytes

Contents

# frozen_string_literal: true

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

    reversible do |dir|
      dir.up do
        Decidim::ParticipatoryProcess.reset_column_information
        Decidim::ParticipatoryProcess.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-participatory_processes-0.26.8 db/migrate/20210310120750_add_followable_counter_cache_to_participatory_processes.rb
decidim-participatory_processes-0.27.4 db/migrate/20210310120750_add_followable_counter_cache_to_participatory_processes.rb
decidim-participatory_processes-0.27.3 db/migrate/20210310120750_add_followable_counter_cache_to_participatory_processes.rb
decidim-participatory_processes-0.26.7 db/migrate/20210310120750_add_followable_counter_cache_to_participatory_processes.rb
decidim-participatory_processes-0.26.5 db/migrate/20210310120750_add_followable_counter_cache_to_participatory_processes.rb
decidim-participatory_processes-0.27.2 db/migrate/20210310120750_add_followable_counter_cache_to_participatory_processes.rb
decidim-participatory_processes-0.27.1 db/migrate/20210310120750_add_followable_counter_cache_to_participatory_processes.rb
decidim-participatory_processes-0.26.4 db/migrate/20210310120750_add_followable_counter_cache_to_participatory_processes.rb
decidim-participatory_processes-0.27.0 db/migrate/20210310120750_add_followable_counter_cache_to_participatory_processes.rb
decidim-participatory_processes-0.26.3 db/migrate/20210310120750_add_followable_counter_cache_to_participatory_processes.rb
decidim-participatory_processes-0.27.0.rc2 db/migrate/20210310120750_add_followable_counter_cache_to_participatory_processes.rb
decidim-participatory_processes-0.27.0.rc1 db/migrate/20210310120750_add_followable_counter_cache_to_participatory_processes.rb
decidim-participatory_processes-0.26.2 db/migrate/20210310120750_add_followable_counter_cache_to_participatory_processes.rb
decidim-participatory_processes-0.26.1 db/migrate/20210310120750_add_followable_counter_cache_to_participatory_processes.rb
decidim-participatory_processes-0.26.0 db/migrate/20210310120750_add_followable_counter_cache_to_participatory_processes.rb
decidim-participatory_processes-0.26.0.rc2 db/migrate/20210310120750_add_followable_counter_cache_to_participatory_processes.rb
decidim-participatory_processes-0.26.0.rc1 db/migrate/20210310120750_add_followable_counter_cache_to_participatory_processes.rb
decidim-participatory_processes-0.25.2 db/migrate/20210310120750_add_followable_counter_cache_to_participatory_processes.rb
decidim-participatory_processes-0.25.1 db/migrate/20210310120750_add_followable_counter_cache_to_participatory_processes.rb
decidim-participatory_processes-0.25.0 db/migrate/20210310120750_add_followable_counter_cache_to_participatory_processes.rb