From 9f1f5271e62e5121fcc4cc8132ef83b041598824 Mon Sep 17 00:00:00 2001 From: Brandon Dunne Date: Thu, 5 Nov 2020 18:35:01 -0500 Subject: [PATCH] Look in the correct places for migrations to determine the deployment_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 --- lib/tasks/evm_application.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/tasks/evm_application.rb b/lib/tasks/evm_application.rb index 15c99ee591c..85f58d9080a 100644 --- a/lib/tasks/evm_application.rb +++ b/lib/tasks/evm_application.rb @@ -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?