Sha256: 33fa8d26401d2d0cc17ba3dd87ddce3c7b2dd0a143bad2f1ffba5bf98b26b1fe

Contents?: true

Size: 1.16 KB

Versions: 195

Compression:

Stored size: 1.16 KB

Contents

class AddErrataCounts < ActiveRecord::Migration[4.2]
  def up
    add_column :katello_content_facets, :installable_security_errata_count, :integer, :null => false, :default => 0
    add_column :katello_content_facets, :installable_enhancement_errata_count, :integer, :null => false, :default => 0
    add_column :katello_content_facets, :installable_bugfix_errata_count, :integer, :null => false, :default => 0

    add_column :katello_content_facets, :applicable_rpm_count, :integer, :null => false, :default => 0
    add_column :katello_content_facets, :upgradable_rpm_count, :integer, :null => false, :default => 0

    Katello::Host::ContentFacet.reset_column_information
    Katello::Host::ContentFacet.find_each do |content_facet|
      content_facet.update_applicability_counts
    end
  end

  def down
    remove_column :katello_content_facets, :installable_security_errata_count
    remove_column :katello_content_facets, :installable_enhancement_errata_count
    remove_column :katello_content_facets, :installable_bugfix_errata_count

    remove_column :katello_content_facets, :applicable_rpm_count
    remove_column :katello_content_facets, :upgradable_rpm_count
  end
end

Version data entries

195 entries across 195 versions & 1 rubygems

Version Path
katello-4.14.2 db/migrate/20170913183848_add_errata_counts.rb
katello-4.15.0 db/migrate/20170913183848_add_errata_counts.rb
katello-4.15.0.rc2 db/migrate/20170913183848_add_errata_counts.rb
katello-4.15.0.rc1 db/migrate/20170913183848_add_errata_counts.rb
katello-4.14.1 db/migrate/20170913183848_add_errata_counts.rb
katello-4.14.0 db/migrate/20170913183848_add_errata_counts.rb
katello-4.14.0.rc3 db/migrate/20170913183848_add_errata_counts.rb
katello-4.14.0.rc2 db/migrate/20170913183848_add_errata_counts.rb
katello-4.14.0.rc1.1 db/migrate/20170913183848_add_errata_counts.rb
katello-4.14.0.rc1 db/migrate/20170913183848_add_errata_counts.rb
katello-4.13.1 db/migrate/20170913183848_add_errata_counts.rb
katello-4.13.0 db/migrate/20170913183848_add_errata_counts.rb
katello-4.12.1 db/migrate/20170913183848_add_errata_counts.rb
katello-4.13.0.rc1 db/migrate/20170913183848_add_errata_counts.rb
katello-4.12.0 db/migrate/20170913183848_add_errata_counts.rb
katello-4.12.0.rc3 db/migrate/20170913183848_add_errata_counts.rb
katello-4.12.0.rc2 db/migrate/20170913183848_add_errata_counts.rb
katello-4.12.0.rc1 db/migrate/20170913183848_add_errata_counts.rb
katello-4.11.1 db/migrate/20170913183848_add_errata_counts.rb
katello-4.11.0 db/migrate/20170913183848_add_errata_counts.rb