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.0 db/migrate/20210310120708_add_followable_counter_cache_to_votings.rb
decidim-elections-0.26.0.rc2 db/migrate/20210310120708_add_followable_counter_cache_to_votings.rb
decidim-elections-0.26.0.rc1 db/migrate/20210310120708_add_followable_counter_cache_to_votings.rb
decidim-elections-0.25.2 db/migrate/20210310120708_add_followable_counter_cache_to_votings.rb
decidim-elections-0.25.1 db/migrate/20210310120708_add_followable_counter_cache_to_votings.rb
decidim-elections-0.25.0 db/migrate/20210310120708_add_followable_counter_cache_to_votings.rb
decidim-elections-0.25.0.rc4 db/migrate/20210310120708_add_followable_counter_cache_to_votings.rb
decidim-elections-0.25.0.rc3 db/migrate/20210310120708_add_followable_counter_cache_to_votings.rb
decidim-elections-0.25.0.rc2 db/migrate/20210310120708_add_followable_counter_cache_to_votings.rb
decidim-elections-0.25.0.rc1 db/migrate/20210310120708_add_followable_counter_cache_to_votings.rb
decidim-elections-0.24.3 db/migrate/20210310120708_add_followable_counter_cache_to_votings.rb
decidim-elections-0.24.2 db/migrate/20210310120708_add_followable_counter_cache_to_votings.rb
decidim-elections-0.24.1 db/migrate/20210310120708_add_followable_counter_cache_to_votings.rb
decidim-elections-0.24.0 db/migrate/20210310120708_add_followable_counter_cache_to_votings.rb