diff --git a/db/migrate/20181002192054_fix_conversion_host_resource_type.rb b/db/migrate/20181002192054_fix_conversion_host_resource_type.rb new file mode 100644 index 000000000..e49f9c60d --- /dev/null +++ b/db/migrate/20181002192054_fix_conversion_host_resource_type.rb @@ -0,0 +1,14 @@ +class FixConversionHostResourceType < ActiveRecord::Migration[5.0] + class ConversionHost < ActiveRecord::Base + self.inheritance_column = :_type_disabled + include ActiveRecord::IdRegions + end + + def up + say_with_time("Converting invalid resource_type to Host") do + ConversionHost.in_my_region + .where(:resource_type => "AddConversionHostIdToMiqRequestTasks::Host") + .update_all(:resource_type => "Host") + end + end +end