Sha256: 100651deb3bf1df3153366b786dbea00e9d7795741b54c71d5cab950c402af2a

Contents?: true

Size: 473 Bytes

Versions: 34

Compression:

Stored size: 473 Bytes

Contents

# frozen_string_literal: true

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

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

Version data entries

34 entries across 34 versions & 1 rubygems

Version Path
decidim-elections-0.26.10 db/migrate/20210310120708_add_followable_counter_cache_to_votings.rb
decidim-elections-0.26.9 db/migrate/20210310120708_add_followable_counter_cache_to_votings.rb
decidim-elections-0.28.0 db/migrate/20210310120708_add_followable_counter_cache_to_votings.rb
decidim-elections-0.27.5 db/migrate/20210310120708_add_followable_counter_cache_to_votings.rb
decidim-elections-0.28.0.rc5 db/migrate/20210310120708_add_followable_counter_cache_to_votings.rb
decidim-elections-0.28.0.rc4 db/migrate/20210310120708_add_followable_counter_cache_to_votings.rb
decidim-elections-0.26.8 db/migrate/20210310120708_add_followable_counter_cache_to_votings.rb
decidim-elections-0.27.4 db/migrate/20210310120708_add_followable_counter_cache_to_votings.rb
decidim-elections-0.27.3 db/migrate/20210310120708_add_followable_counter_cache_to_votings.rb
decidim-elections-0.26.7 db/migrate/20210310120708_add_followable_counter_cache_to_votings.rb
decidim-elections-0.26.5 db/migrate/20210310120708_add_followable_counter_cache_to_votings.rb
decidim-elections-0.27.2 db/migrate/20210310120708_add_followable_counter_cache_to_votings.rb
decidim-elections-0.27.1 db/migrate/20210310120708_add_followable_counter_cache_to_votings.rb
decidim-elections-0.26.4 db/migrate/20210310120708_add_followable_counter_cache_to_votings.rb
decidim-elections-0.27.0 db/migrate/20210310120708_add_followable_counter_cache_to_votings.rb
decidim-elections-0.26.3 db/migrate/20210310120708_add_followable_counter_cache_to_votings.rb
decidim-elections-0.27.0.rc2 db/migrate/20210310120708_add_followable_counter_cache_to_votings.rb
decidim-elections-0.27.0.rc1 db/migrate/20210310120708_add_followable_counter_cache_to_votings.rb
decidim-elections-0.26.2 db/migrate/20210310120708_add_followable_counter_cache_to_votings.rb
decidim-elections-0.26.1 db/migrate/20210310120708_add_followable_counter_cache_to_votings.rb