Skip to content

Commit

Permalink
Merge pull request ManageIQ#19887 from bdunne/delete_region_migration…
Browse files Browse the repository at this point in the history
…s_ran

MiqRegion#migrations_ran column is no longer necessary
  • Loading branch information
carbonin authored Feb 27, 2020
2 parents 480e913 + cabbf08 commit 67c2962
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 12 deletions.
10 changes: 2 additions & 8 deletions app/models/miq_region.rb
Original file line number Diff line number Diff line change
Expand Up @@ -111,16 +111,10 @@ def self.seed
my_region_id = my_region_number
db_region_id = MiqDatabase.first.try(:region_id)
if db_region_id && db_region_id != my_region_id
raise Exception,
_("Region [%{region_id}] does not match the database's region [%{db_id}]") % {:region_id => my_region_id,
:db_id => db_region_id}
raise Exception, _("Region [%{region_id}] does not match the database's region [%{db_id}]") % {:region_id => my_region_id, :db_id => db_region_id}
end
create_params = {
:description => "Region #{my_region_id}",
:migrations_ran => ActiveRecord::SchemaMigration.normalized_versions
}

create_with(create_params).find_or_create_by!(:region => my_region_id) do
create_with(:description => "Region #{my_region_id}").find_or_create_by!(:region => my_region_id) do
_log.info("Creating Region [#{my_region_id}]")
end
end
Expand Down
4 changes: 0 additions & 4 deletions spec/models/miq_region_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -67,10 +67,6 @@
allow(MiqRegion).to receive_messages(:my_region_number => @region_number + 1)
expect { MiqRegion.seed }.to raise_error(Exception)
end

it "sets the migrations_ran column" do
expect(MiqRegion.first.migrations_ran).to match_array(ActiveRecord::SchemaMigration.normalized_versions)
end
end

describe ".replication_type" do
Expand Down

0 comments on commit 67c2962

Please sign in to comment.