Self service

Insert and use the new table

, Claim Case

, add new columns

index

HOR-1345

.

HOR-1345

Priority
This commit is contained in:
Paula V. Quispe
2016-06-22 11:27:43 -04:00
parent 03c58f3714
commit 29100e3513
12 changed files with 502 additions and 271 deletions

View File

@@ -255,6 +255,19 @@ 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");
/*----------------------------------********---------------------------------*/
/**
@@ -364,13 +377,16 @@ function run_database_check($args, $opts) {
function run_migrate_new_cases_lists($args, $opts) {
migrate_new_cases_lists("migrate", $args, $opts);
}
function run_migrate_counters($args, $opts) {
migrate_counters("migrate", $args);
}
function run_migrate_list_unassigned($args, $opts) {
migrate_list_unassigned("migrate", $args, $opts);
}
function database_upgrade($command, $args) {
G::LoadSystem('inputfilter');
$filter = new InputFilter();
@@ -809,5 +825,23 @@ function migrate_counters($command, $args) {
}
}
}
function migrate_list_unassigned($command, $args, $opts) {
G::LoadSystem('inputfilter');
$filter = new InputFilter();
$opts = $filter->xssFilterHard($opts);
$args = $filter->xssFilterHard($args);
$lang = array_key_exists("lang", $opts) ? $opts['lang'] : 'en';
$workspaces = get_workspaces_from_args($args);
foreach ($workspaces as $workspace) {
print_r("Upgrading Unassigned List in" . pakeColor::colorize($workspace->name, "INFO") . "\n");
try {
$workspace->regenerateListUnassigned();
echo "> Unassigned List is done\n";
} catch (Exception $e) {
echo "> Error: ".CLI::error($e->getMessage()) . "\n";
}
}
}
/*----------------------------------********---------------------------------*/