Sha256: a538033f65a806808e20706447bb1844193a7878bde82ecd1d99d150176061bc

Contents?: true

Size: 476 Bytes

Versions: 50

Compression:

Stored size: 476 Bytes

Contents

# frozen_string_literal: true

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

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

Version data entries

50 entries across 50 versions & 1 rubygems

Version Path
decidim-budgets-0.25.1 db/migrate/20210310120613_add_followable_counter_cache_to_budgets.rb
decidim-budgets-0.25.0 db/migrate/20210310120613_add_followable_counter_cache_to_budgets.rb
decidim-budgets-0.25.0.rc4 db/migrate/20210310120613_add_followable_counter_cache_to_budgets.rb
decidim-budgets-0.25.0.rc3 db/migrate/20210310120613_add_followable_counter_cache_to_budgets.rb
decidim-budgets-0.25.0.rc2 db/migrate/20210310120613_add_followable_counter_cache_to_budgets.rb
decidim-budgets-0.25.0.rc1 db/migrate/20210310120613_add_followable_counter_cache_to_budgets.rb
decidim-budgets-0.24.3 db/migrate/20210310120613_add_followable_counter_cache_to_budgets.rb
decidim-budgets-0.24.2 db/migrate/20210310120613_add_followable_counter_cache_to_budgets.rb
decidim-budgets-0.24.1 db/migrate/20210310120613_add_followable_counter_cache_to_budgets.rb
decidim-budgets-0.24.0 db/migrate/20210310120613_add_followable_counter_cache_to_budgets.rb