Merged in bugfix/HOR-4636 (pull request #6524)

HOR-4636

Approved-by: Julio Cesar Laura Avendaño <contact@julio-laura.com>
This commit is contained in:
Roly
2018-06-19 18:12:27 +00:00
committed by Julio Cesar Laura Avendaño
2 changed files with 17 additions and 16 deletions

View File

@@ -289,6 +289,12 @@ class WorkspaceTools
$stop = microtime(true); $stop = microtime(true);
CLI::logging("<*> Optimizing content data took " . ($stop - $start) . " seconds.\n"); CLI::logging("<*> Optimizing content data took " . ($stop - $start) . " seconds.\n");
$start = microtime(true);
CLI::logging("> Migrating and populating indexing for avoiding the use of table APP_CACHE_VIEW...\n");
$this->migratePopulateIndexingACV($workSpace);
$stop = microtime(true);
CLI::logging("<*> Migrating an populating indexing for avoiding the use of table APP_CACHE_VIEW process took " . ($stop - $start) . " seconds.\n");
/*----------------------------------********---------------------------------*/ /*----------------------------------********---------------------------------*/
$start = microtime(true); $start = microtime(true);
CLI::logging("> Migrate new lists...\n"); CLI::logging("> Migrate new lists...\n");
@@ -316,12 +322,6 @@ class WorkspaceTools
$stop = microtime(true); $stop = microtime(true);
CLI::logging("<*> Migrating Self-Service records Process took " . ($stop - $start) . " seconds.\n"); CLI::logging("<*> Migrating Self-Service records Process took " . ($stop - $start) . " seconds.\n");
$start = microtime(true);
CLI::logging("> Migrating and populating indexing for avoiding the use of table APP_CACHE_VIEW...\n");
$this->migratePopulateIndexingACV($workSpace);
$stop = microtime(true);
CLI::logging("<*> Migrating an populating indexing for avoiding the use of table APP_CACHE_VIEW process took " . ($stop - $start) . " seconds.\n");
$start = microtime(true); $start = microtime(true);
CLI::logging("> Updating rows in Web Entry table for classic processes...\n"); CLI::logging("> Updating rows in Web Entry table for classic processes...\n");
$this->updatingWebEntryClassicModel($workSpace); $this->updatingWebEntryClassicModel($workSpace);
@@ -1249,6 +1249,7 @@ class WorkspaceTools
public function upgradeData() public function upgradeData()
{ {
$this->getSchema();
if (file_exists(PATH_CORE . 'data' . PATH_SEP . 'check.data')) { if (file_exists(PATH_CORE . 'data' . PATH_SEP . 'check.data')) {
$checkData = unserialize(file_get_contents(PATH_CORE . 'data' . PATH_SEP . 'check.data')); $checkData = unserialize(file_get_contents(PATH_CORE . 'data' . PATH_SEP . 'check.data'));
if (is_array($checkData)) { if (is_array($checkData)) {
@@ -2029,6 +2030,13 @@ class WorkspaceTools
$stop = microtime(true); $stop = microtime(true);
CLI::logging("<*> Optimizing content data took " . ($stop - $start) . " seconds.\n"); CLI::logging("<*> Optimizing content data took " . ($stop - $start) . " seconds.\n");
//Populate the new fields for replace string UID to Interger ID
$start = microtime(true);
CLI::logging("> Migrating and populating indexing for APP_CACHE_VIEW...\n");
$workspace->migratePopulateIndexingACV($workspace->name);
$stop = microtime(true);
CLI::logging("<*> Migrating an populating indexing for APP_CACHE_VIEW process took " . ($stop - $start) . " seconds.\n");
//Move the data of cases to the corresponding List //Move the data of cases to the corresponding List
/*----------------------------------********---------------------------------*/ /*----------------------------------********---------------------------------*/
$start = microtime(true); $start = microtime(true);
@@ -2044,13 +2052,6 @@ class WorkspaceTools
$stop = microtime(true); $stop = microtime(true);
CLI::logging("<*> Updating Files Manager took " . ($stop - $start) . " seconds.\n"); CLI::logging("<*> Updating Files Manager took " . ($stop - $start) . " seconds.\n");
//Populate the new fields for replace string UID to Interger ID
$start = microtime(true);
CLI::logging("> Migrating and populating indexing for APP_CACHE_VIEW...\n");
$workspace->migratePopulateIndexingACV($workspace->name);
$stop = microtime(true);
CLI::logging("<*> Migrating an populating indexing for APP_CACHE_VIEW process took " . ($stop - $start) . " seconds.\n");
//Updating generated class files for PM Tables //Updating generated class files for PM Tables
passthru(PHP_BINARY . ' processmaker regenerate-pmtable-classes ' . $workspace->name); passthru(PHP_BINARY . ' processmaker regenerate-pmtable-classes ' . $workspace->name);

View File

@@ -323,7 +323,7 @@ class Content extends BaseContent
DB::connection($connection)->statement($query); DB::connection($connection)->statement($query);
$languages = DB::table('CONTENT')->select('CON_LANG')->distinct()->get(); $languages = DB::connection($connection)->table('CONTENT')->select('CON_LANG')->distinct()->get();
foreach ($languages as $value) { foreach ($languages as $value) {
if (array_search($value->CON_LANG, $langs) === false) { if (array_search($value->CON_LANG, $langs) === false) {
@@ -335,7 +335,7 @@ class Content extends BaseContent
DB::connection($connection)->statement('SET FOREIGN_KEY_CHECKS=0'); DB::connection($connection)->statement('SET FOREIGN_KEY_CHECKS=0');
DB::connection($connection)->statement('SET SQL_BIG_SELECTS=1'); DB::connection($connection)->statement('SET SQL_BIG_SELECTS=1');
$result = DB::table('CONTENT') $result = DB::connection($connection)->table('CONTENT')
->select('CON_ID', 'CON_CATEGORY', 'CON_LANG', 'CON_PARENT', 'CON_VALUE') ->select('CON_ID', 'CON_CATEGORY', 'CON_LANG', 'CON_PARENT', 'CON_VALUE')
->orderBy('CON_ID', 'CON_CATEGORY', 'CON_LANG', 'CON_PARENT', 'CON_VALUE') ->orderBy('CON_ID', 'CON_CATEGORY', 'CON_LANG', 'CON_PARENT', 'CON_VALUE')
->get(); ->get();
@@ -385,7 +385,7 @@ class Content extends BaseContent
DB::connection($connection)->statement('DROP TABLE CONTENT_BACKUP'); DB::connection($connection)->statement('DROP TABLE CONTENT_BACKUP');
$result = DB::connection($connection) $result = DB::connection($connection)
->select("SELECT * FROM information_schema.processlist WHERE command = 'Sleep' and user = SUBSTRING_INDEX(USER(),'@',1) and db = DATABASE() ORDER BY id"); ->select("SELECT * FROM information_schema.processlist WHERE COMMAND = 'Sleep' AND USER = SUBSTRING_INDEX(USER(),'@',1) AND DB = DATABASE() AND TIME > 0 ORDER BY ID");
foreach ($result as $value) { foreach ($result as $value) {
DB::connection($connection)->statement('kill ' . $value->ID); DB::connection($connection)->statement('kill ' . $value->ID);