Sha256: 8795036f4236ac2449d452a9cbb97b4fda419093553b529eafbd80efb224a075

Contents?: true

Size: 625 Bytes

Versions: 67

Compression:

Stored size: 625 Bytes

Contents

class KatelloPoolOrganizationIdNotNullable < ActiveRecord::Migration[6.0]
  def up
    ::Katello::Pool.where(organization_id: nil).destroy_all
    ::Katello::Pool.where(subscription_id: nil).destroy_all

    change_column :katello_pools, :organization_id, :integer, null: false
    change_column :katello_pools, :subscription_id, :integer, null: false

    add_index :katello_pools, :organization_id
  end

  def down
    change_column :katello_pools, :organization_id, :integer, null: true
    change_column :katello_pools, :subscription_id, :integer, null: true

    remove_index :katello_pools, :organization_id
  end
end

Version data entries

67 entries across 67 versions & 1 rubygems

Version Path
katello-4.3.1 db/migrate/20210331180353_katello_pool_organization_id_not_nullable.rb
katello-4.4.0 db/migrate/20210331180353_katello_pool_organization_id_not_nullable.rb
katello-4.4.0.rc2 db/migrate/20210331180353_katello_pool_organization_id_not_nullable.rb
katello-4.4.0.rc1 db/migrate/20210331180353_katello_pool_organization_id_not_nullable.rb
katello-4.2.2 db/migrate/20210331180353_katello_pool_organization_id_not_nullable.rb
katello-4.3.0 db/migrate/20210331180353_katello_pool_organization_id_not_nullable.rb
katello-4.3.0.rc4 db/migrate/20210331180353_katello_pool_organization_id_not_nullable.rb