Sha256: cf8a6564e0ae211f4b7ee3b31eb38817dce5a8155eca08c337b774e82a404b39

Contents?: true

Size: 882 Bytes

Versions: 148

Compression:

Stored size: 882 Bytes

Contents

class MigrateDistributionReferenceToUseRepoId < ActiveRecord::Migration[5.2]
  class DistributionReference < Katello::Model
    self.table_name = 'katello_distribution_references'
  end

  def up
    #this was done before being deployed in production, so this should be okay,
    # although existing pulp3 repos will not work properly
    DistributionReference.destroy_all

    #work around sqlite add_column with non_null issue
    add_column :katello_distribution_references, :repository_id, :integer, :index => true
    change_column :katello_distribution_references, :repository_id, :integer, :null => false

    remove_column :katello_distribution_references, :root_repository_id
    add_foreign_key :katello_distribution_references, :katello_repositories, :column => :repository_id, :primary_key => :id
  end

  def down
    fail ActiveRecord::IrreversibleMigration
  end
end

Version data entries

148 entries across 148 versions & 1 rubygems

Version Path
katello-4.7.3 db/migrate/20191204020703_migrate_distribution_reference_to_use_repo_id.rb
katello-4.7.2 db/migrate/20191204020703_migrate_distribution_reference_to_use_repo_id.rb
katello-4.7.1 db/migrate/20191204020703_migrate_distribution_reference_to_use_repo_id.rb
katello-4.6.2.1 db/migrate/20191204020703_migrate_distribution_reference_to_use_repo_id.rb
katello-4.6.2 db/migrate/20191204020703_migrate_distribution_reference_to_use_repo_id.rb
katello-4.7.0 db/migrate/20191204020703_migrate_distribution_reference_to_use_repo_id.rb
katello-4.6.1 db/migrate/20191204020703_migrate_distribution_reference_to_use_repo_id.rb
katello-4.7.0.rc2 db/migrate/20191204020703_migrate_distribution_reference_to_use_repo_id.rb
katello-4.7.0.rc1 db/migrate/20191204020703_migrate_distribution_reference_to_use_repo_id.rb
katello-4.4.2.2 db/migrate/20191204020703_migrate_distribution_reference_to_use_repo_id.rb
katello-4.4.2.1 db/migrate/20191204020703_migrate_distribution_reference_to_use_repo_id.rb
katello-4.4.2 db/migrate/20191204020703_migrate_distribution_reference_to_use_repo_id.rb
katello-4.5.1 db/migrate/20191204020703_migrate_distribution_reference_to_use_repo_id.rb
katello-4.6.0 db/migrate/20191204020703_migrate_distribution_reference_to_use_repo_id.rb
katello-4.6.0.rc2 db/migrate/20191204020703_migrate_distribution_reference_to_use_repo_id.rb
katello-4.6.0.rc1 db/migrate/20191204020703_migrate_distribution_reference_to_use_repo_id.rb
katello-4.5.0 db/migrate/20191204020703_migrate_distribution_reference_to_use_repo_id.rb
katello-4.5.0.rc2 db/migrate/20191204020703_migrate_distribution_reference_to_use_repo_id.rb
katello-4.4.1 db/migrate/20191204020703_migrate_distribution_reference_to_use_repo_id.rb
katello-4.5.0.rc1 db/migrate/20191204020703_migrate_distribution_reference_to_use_repo_id.rb