From e771881772694573b26e29520f6c2929d5460c31 Mon Sep 17 00:00:00 2001
From: Uma <uma.s@vtiger.com>
Date: Thu, 29 Oct 2020 22:40:06 +0530
Subject: [PATCH] Updating packages during migration is generalized, instead of
 individual script level

---
 modules/Migration/schema/711_to_720.php |  3 ---
 modules/Migration/schema/720_to_730.php |  3 ---
 modules/Migration/views/Index.php       | 13 +++++++++++++
 3 files changed, 13 insertions(+), 6 deletions(-)

diff --git a/modules/Migration/schema/711_to_720.php b/modules/Migration/schema/711_to_720.php
index 8a75abe10..8ef2b7b49 100644
--- a/modules/Migration/schema/711_to_720.php
+++ b/modules/Migration/schema/711_to_720.php
@@ -18,7 +18,4 @@ if (defined('VTIGER_UPGRADE')) {
     if(!in_array($columnName,$columns)) {
         $db->pquery('ALTER TABLE vtiger_attachments ADD COLUMN storedname varchar(255) NULL AFTER path', array());
     }
-    
-    //Update existing package modules
-    Install_Utils_Model::installModules();
 }
diff --git a/modules/Migration/schema/720_to_730.php b/modules/Migration/schema/720_to_730.php
index 78f27fb62..d048909f4 100644
--- a/modules/Migration/schema/720_to_730.php
+++ b/modules/Migration/schema/720_to_730.php
@@ -297,7 +297,4 @@ if (defined('VTIGER_UPGRADE')) {
     $db->pquery('ALTER TABLE vtiger_calendar_default_activitytypes ADD COLUMN conditions VARCHAR(255) DEFAULT ""', array());
     
     echo 'Conditions column in vtiger_calendar_default_activitytypes updated';
-    
-    //Update existing package modules
-    Install_Utils_Model::installModules();
 }
\ No newline at end of file
diff --git a/modules/Migration/views/Index.php b/modules/Migration/views/Index.php
index caecf7dba..f83ca7305 100644
--- a/modules/Migration/views/Index.php
+++ b/modules/Migration/views/Index.php
@@ -129,6 +129,19 @@ class Migration_Index_View extends Vtiger_View_Controller {
 				echo "<table class='config-table'><tr><th><span><b><font color='red'> There is no Database Changes from ".$migrateVersions[$i]." ==> ".$migrateVersions[$i+1]."</font></b></span></th></tr></table>";
 			}
 		}
+                
+                //During migration process we need to upgrade the package changes
+                if(defined('VTIGER_UPGRADE')) {
+		
+			echo "<table class='config-table'><tr><th><span><b><font color='red'> Upgrading Modules -- Starts. </font></b></span></th></tr></table>";
+			echo "<table class='config-table'>";
+	
+			//Update existing package modules
+			Install_Utils_Model::installModules();
+
+			echo "<table class='config-table'><tr><th><span><b><font color='red'>Upgrading Modules -- Ends.</font></b></span></th></tr></table>";
+			
+		}
 
 		//update vtiger version in db
 		$migrationModuleModel->updateVtigerVersion();
-- 
GitLab