Skip to content

Commit

Permalink
Look in the correct places for migrations to determine the deployment…
Browse files Browse the repository at this point in the history
…_status

Our schema migrations don't live in db/migrate, they live in the
manageiq-schema gem. So we were incorrectly reporting that we don't have
any migrations that need to be run.

irb(main):001:0> ActiveRecord::MigrationContext.new('db/migrate').migrations.length
=> 0
irb(main):002:0> ActiveRecord::MigrationContext.new(Rails.application.config.paths["db/migrate"]).migrations.length
=> 844
  • Loading branch information
bdunne committed Nov 5, 2020
1 parent 1fbd2e6 commit 9f1f527
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/tasks/evm_application.rb
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ def self.encryption_key_valid?
end

def self.deployment_status
context = ActiveRecord::MigrationContext.new('db/migrate')
context = ActiveRecord::MigrationContext.new(Rails.application.config.paths["db/migrate"])
return "new_deployment" if context.current_version.zero?
return "new_replica" if MiqServer.my_server.nil?
return "upgrade" if context.needs_migration?
Expand Down

0 comments on commit 9f1f527

Please sign in to comment.