Skip to content

Commit

Permalink
Fix missing end preventing the down migration from running in rails 7
Browse files Browse the repository at this point in the history
  • Loading branch information
jrafanie committed May 23, 2024
1 parent 4198b54 commit 1d31791
Showing 1 changed file with 10 additions and 11 deletions.
21 changes: 10 additions & 11 deletions db/migrate/20220111170303_fix_child_container_manager_sti.rb
Original file line number Diff line number Diff line change
Expand Up @@ -46,18 +46,17 @@ def up
ServiceParametersSet.in_my_region.where(:ext_management_system => managers).update_all(:type => "#{provider_klass}::ServiceParametersSet")
end
end
end

def down
PROVIDERS.each do |provider|
provider_klass = "ManageIQ::Providers::#{provider}::ContainerManager"
say_with_time("Resetting STI class for #{provider_klass}") do
managers = ExtManagementSystem.in_my_region.where(:type => provider_klass)

ContainerTemplate.in_my_region.where(:ext_management_system => managers).update_all(:type => nil)
ServiceInstance.in_my_region.where(:ext_management_system => managers).update_all(:type => nil)
ServiceOffering.in_my_region.where(:ext_management_system => managers).update_all(:type => nil)
ServiceParametersSet.in_my_region.where(:ext_management_system => managers).update_all(:type => nil)
end
def down
PROVIDERS.each do |provider|
provider_klass = "ManageIQ::Providers::#{provider}::ContainerManager"
say_with_time("Resetting STI class for #{provider_klass}") do
managers = ExtManagementSystem.in_my_region.where(:type => provider_klass)
ContainerTemplate.in_my_region.where(:ext_management_system => managers).update_all(:type => nil)
ServiceInstance.in_my_region.where(:ext_management_system => managers).update_all(:type => nil)
ServiceOffering.in_my_region.where(:ext_management_system => managers).update_all(:type => nil)
ServiceParametersSet.in_my_region.where(:ext_management_system => managers).update_all(:type => nil)
end
end
end
Expand Down

0 comments on commit 1d31791

Please sign in to comment.