Sha256: 15c8ee3043cd5c5b18e0f6d329f2568ed5a0dc428a9117c328b42ae4c79b4be4

Contents?: true

Size: 1.23 KB

Versions: 193

Compression:

Stored size: 1.23 KB

Contents

class FillInContentViewComponents < ActiveRecord::Migration[4.2]
  class FakeContentView < ApplicationRecord
    self.table_name = 'katello_content_views'

    has_many :content_view_components, :class_name => "FakeContentViewVersion", :dependent => :destroy,
             :inverse_of => :composite_content_view, :foreign_key => :composite_content_view_id
  end

  class FakeContentViewVersion < ApplicationRecord
    self.table_name = 'katello_content_view_versions'

    has_many :content_view_components, :inverse_of => :content_view_version, :dependent => :destroy, :class_name => 'FakeContentViewComponent'
  end

  class FakeContentViewComponent < ApplicationRecord
    self.table_name = 'katello_content_view_components'

    belongs_to :content_view_version, :class_name => "FakeContentViewVersion",
                              :inverse_of => :content_view_components
    belongs_to :content_view, :class_name => "FakeContentView",
                              :inverse_of => :component_composites
  end

  def up
    FakeContentViewComponent.find_each do |cvc|
      if cvc.content_view_id.nil? && cvc.content_view_version_id
        cvc.content_view_id = cvc.content_view_version.content_view_id
        cvc.save!
      end
    end
  end
end

Version data entries

193 entries across 193 versions & 1 rubygems

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