hard rebuild skip confirm

This commit is contained in:
Yuri Kuznetsov
2024-10-10 19:26:56 +03:00
parent 94065bfa34
commit 500ad83af6
2 changed files with 13 additions and 8 deletions
@@ -52,16 +52,18 @@ class Rebuild implements Command
$this->dataManager->rebuild();
if ($params->hasFlag('hard')) {
$message =
"Are you sure you want to run a hard DB rebuild? It will drop unused columns, " .
"decrease exceeding column lengths. It may take some time to process.\nType [Y] to proceed.";
if (!$params->hasFlag('y')) {
$message =
"Are you sure you want to run a hard DB rebuild? It will drop unused columns, " .
"decrease exceeding column lengths. It may take some time to process.\nType [Y] to proceed.";
$io->writeLine($message);
$io->writeLine($message);
$input = $io->readLine();
$input = $io->readLine();
if (strtolower($input) !== 'y') {
return;
if (strtolower($input) !== 'y') {
return;
}
}
$this->dataManager->rebuildDatabase(null, RebuildMode::HARD);
@@ -10,7 +10,10 @@
"rebuild": {
"listed": true,
"noSystemUser": true,
"allowedFlags": ["hard"]
"allowedFlags": [
"hard",
"y"
]
},
"updateAppTimestamp": {
"listed": true,