Skip to content

Commit

Permalink
Refs #37148 - add fake class
Browse files Browse the repository at this point in the history
  • Loading branch information
jeremylenz committed Feb 9, 2024
1 parent 5195646 commit 7945469
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
class RemoveEntitlementModeHostStatuses < ActiveRecord::Migration[6.1]
class FakeTablePreference < ApplicationRecord
self.table_name = 'table_preferences'
serialize :columns
end

def up
obsolete_statuses = [
"Katello::SubscriptionStatus",
Expand All @@ -11,7 +16,7 @@ def up

::HostStatus::Status.where(type: obsolete_statuses).delete_all

::TablePreference.where(name: "hosts").each do |table_preference|
FakeTablePreference.where(name: "hosts").each do |table_preference|
next unless table_preference.columns.include?("subscription_status")
new_columns = table_preference.columns - ["subscription_status"]
if new_columns.present?
Expand Down

0 comments on commit 7945469

Please sign in to comment.