Changeset 12896
- Timestamp:
- 06/29/09 07:31:31 (7 months ago)
- Files:
-
- vtigercrm/branches/5.1/install/4setMigrationConfig.php (modified) (1 diff)
- vtigercrm/branches/5.1/install/5MigrationProcess.php (modified) (1 diff)
- vtigercrm/branches/5.1/install/7createTables.inc.php (modified) (1 diff)
- vtigercrm/branches/5.1/migrate.php (modified) (2 diffs)
- vtigercrm/branches/5.1/modules/Migration/DBChanges/504_to_510rc.php (modified) (2 diffs)
- vtigercrm/branches/5.1/modules/Migration/Performance (deleted)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
vtigercrm/branches/5.1/install/4setMigrationConfig.php
r12877 r12896 426 426 <!-- Right side tabs --> 427 427 <form action="javascript: void(0); " method="post" name="installform" id="form" name="setConfig" id="form"> 428 <input name="action" type="hidden" value='' />429 428 <table border=0 cellspacing=0 cellpadding=5 width=100%> 430 429 <tr><td colspan=2 class=small align=left><img src="include/install/images/confWizSysConfig.gif" alt="System Configuration" title="System Configuration"><br> vtigercrm/branches/5.1/install/5MigrationProcess.php
r12877 r12896 109 109 if(typeof('Event') != 'undefined') { 110 110 Event.observe(window, 'load', function() { 111 console.log(document.getElementById('triggermigration_iframe'));112 111 document.getElementById('triggermigration_iframe').src = 'install.php?file=5MigrationProcess.php&migration_start=true&auth_key='+auth_key+'&skipcache=<?php echo microtime(true); ?>'; 113 112 }); vtigercrm/branches/5.1/install/7createTables.inc.php
r12877 r12896 1035 1035 require_once('include/utils/installVtlibSelectedModules.php'); 1036 1036 1037 // Run the performance scripts based on the database type and the vtiger version.1038 require_once('modules/Migration/versions.php');1039 if($adb->isMySQL()) {1040 @include_once('modules/Migration/Performance/'.$current_version.'_mysql.php');1041 } elseif($adb->isPostgres()) {1042 @include_once('modules/Migration/Performance/'.$current_version.'_postgres.php');1043 }1044 1045 1037 // populate the db with seed data 1046 1038 if ($db_populate) { vtigercrm/branches/5.1/migrate.php
r12877 r12896 197 197 $db_utf8_support = check_db_utf8_support($conn); 198 198 } 199 $filecontents = file_get_contents($dumpfile); 200 $lines = split("\n", $filecontents); 201 foreach($lines as $line) { 202 $line = trim($line); 203 if(empty($line)) continue; 204 if(stripos($line, '--') === 0) { 205 // Ignore comments 206 } else { 199 $file_size = filesize($dumpfile); 200 //Will take effect only if PHP safe-mode is Off 201 if($file_size < 50*1024*1024){ 202 ini_set('memory_limit',2*$file_size); 203 } else { 204 ini_set('memory_limit','100M'); 205 } 206 $fileHandle = fopen($dumpfile,'r'); 207 flush(); 208 ob_flush(); 209 while(!feof($fileHandle )){ 210 $line = fgets($fileHandle); 211 $line = trim($line); 212 flush(); 213 ob_flush(); 214 if(empty($line)) continue; 215 if(stripos($line, '--') === 0) { 216 // Ignore comments 217 } else { 207 218 $db_conn->Execute($line); 208 }209 }219 } 220 } 210 221 $db_conn->Close(); 222 fclose($fileHandle ); 211 223 } 212 224 } else { … … 419 431 echo $start_tag.$temp[$patch_count]." ==> ".$temp[$patch_count+1]." Database changes -- Ends.".$end_tag; 420 432 } 421 if($dbtype == 'mysql') {422 @include_once('modules/Migration/Performance/'.$temp[$patch_count+1].'_mysql.php');423 } elseif($dbtype == 'postgres') {424 @include_once('modules/Migration/Performance/'.$temp[$patch_count+1].'_postgres.php');425 }426 433 } 427 434 vtigercrm/branches/5.1/modules/Migration/DBChanges/504_to_510rc.php
r12877 r12896 675 675 /* Important database schema changes to support database porting */ 676 676 ExecuteQuery("alter table vtiger_attachments drop index attachments_description_type_attachmentsid_idx"); 677 ExecuteQuery("alter table vtiger_attachments modify column description LONGTEXT");678 ExecuteQuery("alter table vtiger_emaildetails modify column idlists LONGTEXT");677 ExecuteQuery("alter table vtiger_attachments modify column description TEXT"); 678 ExecuteQuery("alter table vtiger_emaildetails modify column idlists TEXT"); 679 679 680 680 /* Product Bundles Feature */ … … 1157 1157 'Calendar'=>array ('vtiger_activitygrouprelation','activityid') 1158 1158 ); 1159 for($i=0; $i<$num_rows; $i++) { 1160 $setype = $adb->query_result($sql_result, $i, 'setype'); 1161 $crmid = $adb->query_result($sql_result, $i, 'crmid'); 1162 1163 if(array_key_exists($setype, $groupTables_array)) { 1164 $groupid_sql = "select groupid from vtiger_groups where groupname in (select groupname from ".$groupTables_array[$setype][0]." where ".$groupTables_array[$setype][1]. " = ".$crmid.")"; 1165 $groupid_res = $adb->query($groupid_sql); 1166 if($adb->num_rows($groupid_res)>0){ 1167 $groupid = $adb->query_result($groupid_res, 0, 'groupid'); 1168 } 1169 } 1170 else { 1171 $sql1_res = $adb->query("select crmid as entityid from vtiger_seattachmentsrel where attachmentsid = ".$crmid); 1172 if($adb->num_rows($sql1_res)>0){ 1173 $se_recordid = $adb->query_result($sql1_res, 0, 'entityid'); 1174 1175 $groupid_res = $adb->query("select smownerid from vtiger_crmentity where crmid = ".$se_recordid); 1176 if($adb->num_rows($groupid_res)>0){ 1177 $groupid = $adb->query_result($groupid_res, 0, 'smownerid'); 1178 } 1179 } 1180 } 1181 // Case when due to some data inconsistency, smownerid is set to 0 but there is not group relation for it stored 1182 if(empty($groupid)) { 1183 $groupid = 1; 1184 } 1185 ExecuteQuery("update vtiger_crmentity set smownerid = $groupid where crmid = $crmid"); 1186 } 1187 1159 1160 foreach($groupTables_array as $module=>$index){ 1161 $modulereltable = $index[0]; 1162 $modulerelindex = $index[1]; 1163 ExecuteQuery("update vtiger_crmentity INNER JOIN {$modulereltable} ON vtiger_crmentity.crmid = {$modulereltable}.{$modulerelindex} INNER JOIN vtiger_groups ON vtiger_groups.groupname = {$modulereltable}.groupname set smownerid = vtiger_groups.groupid"); 1164 ExecuteQuery("UPDATE vtiger_crmentity SET smownerid=1 WHERE smownerid=0 AND setype='{$module}'"); 1165 } 1188 1166 // user-group ends 1189 1167
