From 4abb099a6ed30dc1767c09ebc46b4edeea865b9e Mon Sep 17 00:00:00 2001 From: btry Date: Thu, 22 Sep 2022 08:29:53 +0200 Subject: [PATCH] feat(install): show the DB diff when upgrade runs from CLI (#2994) --- install/install.php | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/install/install.php b/install/install.php index 8589b9fa1..f9cdb3d89 100644 --- a/install/install.php +++ b/install/install.php @@ -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; }