diff options
author | John Molakvoæ <skjnldsv@protonmail.com> | 2022-04-07 11:45:54 +0200 |
---|---|---|
committer | John Molakvoæ <skjnldsv@protonmail.com> | 2022-04-07 11:49:20 +0200 |
commit | 0257315c3474a7e4e13af952c6191cedb6abcb99 (patch) | |
tree | c876617f6f1264d624294a52a1af0fa0c1d6e26f /lib | |
parent | 1e5a879d2e64f7c9afe51ed40a9c8eac6d581262 (diff) | |
download | nextcloud-server-0257315c3474a7e4e13af952c6191cedb6abcb99.tar.gz nextcloud-server-0257315c3474a7e4e13af952c6191cedb6abcb99.zip |
Improve error logging on migration failure
Signed-off-by: John Molakvoæ <skjnldsv@protonmail.com>
Diffstat (limited to 'lib')
-rw-r--r-- | lib/private/DB/MigrationService.php | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/lib/private/DB/MigrationService.php b/lib/private/DB/MigrationService.php index b228308cbfe..2b129edca26 100644 --- a/lib/private/DB/MigrationService.php +++ b/lib/private/DB/MigrationService.php @@ -27,7 +27,6 @@ */ namespace OC\DB; -use Doctrine\DBAL\Exception\DriverException; use Doctrine\DBAL\Platforms\OraclePlatform; use Doctrine\DBAL\Platforms\PostgreSQL94Platform; use Doctrine\DBAL\Schema\Index; @@ -424,10 +423,10 @@ class MigrationService { foreach ($toBeExecuted as $version) { try { $this->executeStep($version, $schemaOnly); - } catch (DriverException $e) { + } catch (\Exception $e) { // The exception itself does not contain the name of the migration, // so we wrap it here, to make debugging easier. - throw new \Exception('Database error when running migration ' . $to . ' for app ' . $this->getApp(), 0, $e); + throw new \Exception('Database error when running migration ' . $version . ' for app ' . $this->getApp() . PHP_EOL. $e->getMessage(), 0, $e); } } } @@ -607,7 +606,6 @@ class MigrationService { // we will NOT detect invalid length if the column is not modified if (($sourceColumn === null || $sourceColumn->getLength() !== $thing->getLength() || $sourceColumn->getType()->getName() !== Types::STRING) && $thing->getLength() > 4000 && $thing->getType()->getName() === Types::STRING) { - var_dump($sourceColumn === null, $sourceColumn->getLength(), $thing->getLength(), $sourceColumn->getName()); throw new \InvalidArgumentException('Column "' . $table->getName() . '"."' . $thing->getName() . '" is type String, but exceeding the 4.000 length limit.'); } } |