Issue 122 - Remove App Cache View

This commit is contained in:
Fernando Ontiveros
2025-07-02 11:59:56 -04:00
parent 615f0ff5a0
commit bc9ad2a59b
32 changed files with 906 additions and 8771 deletions

View File

@@ -2,7 +2,6 @@
use ProcessMaker\BusinessModel\WebEntry;
use ProcessMaker\Core\JobsManager;
use ProcessMaker\Model\Delegation;
use ProcessMaker\Model\Process;
use ProcessMaker\Validation\MySQL57;
@@ -58,24 +57,6 @@ CLI::taskOpt("lang", "Specify the language which will be used to rebuild the cas
CLI::taskOpt("port", "Specify the port number used by MySQL. If not specified, then the port 3306 will be used by default.", "p:");
CLI::taskRun("run_workspace_restore");
CLI::taskName('cacheview-repair');
CLI::taskDescription(<<<EOT
Create and populate the APP_CACHE_VIEW table
Specify the workspaces whose cases cache should be repaired. If no workspace
is specified, then the cases will be repaired on all available workspaces.
In order to improve the performance, ProcessMaker includes a cache of cases
in the table APP_CACHE_VIEW. This table must be in sync with the database
to present the correct information in the cases inbox. This command will
create the table and populate it with the right information. This only needs
to be used after upgrading ProcessMaker or if the cases inbox is out of sync.
EOT
);
CLI::taskArg('workspace', true, true);
CLI::taskOpt("lang", "Specify the language to rebuild the case cache list. If not specified, then 'en' (English) will be used by default.\n Ex: -lfr (French) Ex: --lang=zh-CN (Mainland Chinese)", "l:", "lang=");
CLI::taskRun("run_cacheview_upgrade");
CLI::taskName('database-upgrade');
CLI::taskDescription(<<<EOT
Upgrade or repair the database schema to match the latest version
@@ -137,61 +118,6 @@ EOT
CLI::taskOpt("workspace", "Select the workspace whose case folders will be migrated, if multiple workspaces are present in the server.\n Ex: -wworkflow. Ex: --workspace=workflow", "w:", "workspace=");
CLI::taskRun("runStructureDirectories");
CLI::taskName('database-verify-consistency');
CLI::taskDescription(<<<EOT
Verify that the database data is consistent so any database-upgrade operation will be executed flawlessly.
Specify the workspaces whose database schema should be verified. If none are specified, then
all available workspaces will be specified.
This command will read the system schema and data in an attempt to verify the database
integrity. Use this command to check the database data consistency before any costly
database-upgrade operation is planned to be executed.
EOT
);
CLI::taskArg('workspace', true, true);
CLI::taskRun("run_database_verify_consistency");
CLI::taskName('database-verify-migration-consistency');
CLI::taskDescription(<<<EOT
Verify that the already migrated data is consistent there was not
data loss of any kind
Specify the workspaces whose database schema should be verified.
The workspace parameter is mandatory.
This command will read the Cancelled, Completed, Inbox, My Inbox, participated
unassigned data in an attempt to verify the database integrity. It's recommended
to run this script after the migrate cases job has been executed.
EOT
);
CLI::taskArg('workspace', true, true);
CLI::taskRun("run_database_verify_migration_consistency");
CLI::taskName('migrate-itee-to-dummytask');
CLI::taskDescription(<<<EOT
Migrate the Intermediate throw Email Event to Dummy task
Specify the workspaces, the processes in this workspace will be updated.
If no workspace is specified, the command will be run in all workspaces.
EOT
);
CLI::taskArg('workspace', true, true);
CLI::taskRun("run_migrate_itee_to_dummytask");
CLI::taskName("check-workspace-disabled-code");
CLI::taskDescription(<<<EOT
Check disabled code for the specified workspace(s).
This command checks the disabled code in the specified workspace(s).
If no workspace is specified, the command will be run in all workspaces.
More than one workspace can be specified.
EOT
);
CLI::taskArg("workspace-name", true, true);
CLI::taskRun("run_check_workspace_disabled_code");
CLI::taskName('migrate-new-cases-lists');
CLI::taskDescription(<<<EOT
@@ -206,31 +132,6 @@ EOT
CLI::taskArg('workspace', true, true);
CLI::taskRun("run_migrate_new_cases_lists");
CLI::taskName('migrate-list-unassigned');
CLI::taskDescription(<<<EOT
Migrating the AppCacheView table to match the latest version of List Unassigned
  Specify the WORKSPACE to migrate from a existing workspace.
If no workspace is specified, then the tables schema will be upgraded or
migrate on all available workspaces.
EOT
);
CLI::taskArg('workspace', true, true);
CLI::taskRun("run_migrate_list_unassigned");
CLI::taskName('migrate-indexing-acv');
CLI::taskDescription(<<<EOT
Migrate and populate the indexes for the new relation fields to avoid the use of APP_CACHE_VIEW table
Specify the workspace, the self-service cases in this workspace will be updated.
If no workspace is specified, the command will be running in all workspaces.
EOT
);
CLI::taskArg('workspace', true, true);
CLI::taskRun("run_migrate_indexing_acv");
CLI::taskName('migrate-content');
CLI::taskDescription(<<<EOT
Migrating the content schema to match the latest version
@@ -302,9 +203,9 @@ CLI::taskName('regenerate-pmtable-classes');
CLI::taskDescription(<<<EOT
Regenerate the class with incorrect reference
This method recursively finds all PHP files that reference the path PATH_DATA
incorrectly, which is caused by importing processes where the data directory
of ProcessMaker has different routes. Modified files are backed up with the
This method recursively finds all PHP files that reference the path PATH_DATA
incorrectly, which is caused by importing processes where the data directory
of ProcessMaker has different routes. Modified files are backed up with the
extension '.backup' in the same directory.
EOT
);
@@ -378,7 +279,7 @@ CLI::taskDescription(<<<EOT
Example:
./processmaker artisan queue:work --workspace=workflow
To see other command options please refer to the artisan help.
To see other command options please refer to the artisan help.
php artisan --help
EOT
);
@@ -397,7 +298,7 @@ Can be "TrueType" or "TrueTypeUnicode", if the option is not specified the defau
EOT
,'t', 'type=');
CLI::taskOpt('tinymce', <<<EOT
Can be "true" or "false", if the option is not specified the default value is "true". If the value is "false" the optional arguments [FRIENDLYNAME] [FONTPROPERTIES] are omitted.
Can be "true" or "false", if the option is not specified the default value is "true". If the value is "false" the optional arguments [FRIENDLYNAME] [FONTPROPERTIES] are omitted.
EOT
,'tm', 'tinymce=');
CLI::taskArg('fontFileName', false);
@@ -473,7 +374,7 @@ CLI::taskRun('convert_out_docs_from_html2pdf_to_tcpdf');
/**
* Function run_info
*
*
* @param array $args
* @param array $opts
*/
@@ -603,23 +504,6 @@ function translation_upgrade($args, $opts)
}
}
function run_cacheview_upgrade($args, $opts)
{
$filter = new InputFilter();
$opts = $filter->xssFilterHard($opts);
$args = $filter->xssFilterHard($args);
$workspaces = get_workspaces_from_args($args);
$lang = array_key_exists("lang", $opts) ? $opts['lang'] : 'en';
foreach ($workspaces as $workspace) {
try {
G::outRes("Upgrading cache view for " . pakeColor::colorize($workspace->name, "INFO") . "\n");
$workspace->upgradeCacheView(true, false, $lang);
} catch (Exception $e) {
G::outRes("Errors upgrading cache view of workspace " . CLI::info($workspace->name) . ": " . CLI::error($e->getMessage()) . "\n");
}
}
}
function run_plugins_database_upgrade($args, $opts)
{
$workspaces = get_workspaces_from_args($args);
@@ -928,7 +812,7 @@ function run_workspace_restore($args, $opts)
/**
* Migrating cases folders of the workspaces
*
*
* @param array $command
* @param array $args
*/
@@ -955,38 +839,11 @@ function runStructureDirectories($command, $args)
}
}
function run_database_verify_consistency($args, $opts)
{
verifyAppCacheConsistency($args);
}
function run_database_verify_migration_consistency($args, $opts)
{
verifyMigratedDataConsistency($args);
}
function verifyAppCacheConsistency($args)
{
$workspaces = get_workspaces_from_args($args);
foreach ($workspaces as $workspace) {
verifyWorkspaceConsistency($workspace);
}
}
function verifyWorkspaceConsistency($workspace)
{
$isConsistent = true;
print_r("Verifying data in workspace " . pakeColor::colorize($workspace->name, "INFO") . "\n");
$inconsistentUsers = $workspace->hasMissingUsers();
$inconsistentTasks = $workspace->hasMissingTasks();
$inconsistentProcesses = $workspace->hasMissingProcesses();
$inconsistentDelegations = $workspace->hasMissingAppDelegations();
if ($inconsistentUsers || $inconsistentTasks || $inconsistentProcesses || $inconsistentDelegations) {
$isConsistent = false;
}
return $isConsistent;
}
function verifyMigratedDataConsistency($args)
{
@@ -1290,7 +1147,7 @@ function regenerate_pmtable_classes($args, $opts)
/**
* This method migrates data from APP_HISTORY table to APP_DATA_CHANGE_LOG table.
*
*
* @param array $args
* @param string $opts
*/
@@ -1458,8 +1315,8 @@ function check_queries_incompatibilities($wsName)
}
/**
* This function obtains the connection parameters and passes them to the artisan.
* All artisan options can be applied. For more information on artisan options use
* This function obtains the connection parameters and passes them to the artisan.
* All artisan options can be applied. For more information on artisan options use
* php artisan --help
* @param array $args
*/
@@ -1706,7 +1563,7 @@ function convert_old_web_entries($args)
/**
* Populate the new column APPLICATION.APP_TITLE into the APP_DELEGATION table
*
*
* @param array $args
*/
function migrate_case_title_to_threads($args)