Skip to content

Commit

Permalink
feat(install): show the DB diff when upgrade runs from CLI (#2994)
Browse files Browse the repository at this point in the history
  • Loading branch information
btry authored Sep 22, 2022
1 parent 3fb6853 commit 4abb099
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions install/install.php
Original file line number Diff line number Diff line change
Expand Up @@ -849,6 +849,22 @@ public function checkSchema(
}

if (count($differences) > 0) {
foreach ($differences as $table_name => $difference) {
$message = null;
switch ($difference['type']) {
case DatabaseSchemaIntegrityChecker::RESULT_TYPE_ALTERED_TABLE:
$message = sprintf(__('Table schema differs for table "%s".'), $table_name);
break;
case DatabaseSchemaIntegrityChecker::RESULT_TYPE_MISSING_TABLE:
$message = sprintf(__('Table "%s" is missing.'), $table_name);
break;
case DatabaseSchemaIntegrityChecker::RESULT_TYPE_UNKNOWN_TABLE:
$message = sprintf(__('Unknown table "%s" has been found in database.'), $table_name);
break;
}
echo $message . PHP_EOL;
echo $difference['diff'] . PHP_EOL;
}
return false;
}

Expand Down

0 comments on commit 4abb099

Please sign in to comment.