Sha256: 4aab2f89dabf0482cd66d882d1799e33f07440c9211d4fddb0edbd6043aa72c9
Contents?: true
Size: 1009 Bytes
Versions: 141
Compression:
Stored size: 1009 Bytes
Contents
class AddUnlimitedToHostCollection < ActiveRecord::Migration[4.2] class ::Katello::HostCollections < ApplicationRecord end def up add_column :katello_host_collections, :unlimited_content_hosts, :boolean, :default => true change_column :katello_host_collections, :max_content_hosts, :integer, :null => true, :default => nil Katello::HostCollections.reset_column_information Katello::HostCollections.all.each do |coll| if coll.max_content_hosts == -1 coll.update(:unlimited_content_hosts => true, :max_content_hosts => nil) elsif coll.max_content_hosts > 0 coll.update(:unlimited_content_hosts => false) end end end def down Katello::HostCollections.all.each do |coll| coll.update(:max_content_hosts => -1) if coll.unlimited_content_hosts end remove_column :katello_host_collections, :unlimited_content_hosts change_column :katello_host_collections, :max_content_hosts, :integer, :null => false, :default => -1 end end
Version data entries
141 entries across 141 versions & 1 rubygems