mirror of
https://github.com/nextcloud/server.git
synced 2026-04-29 01:50:33 -04:00
Improve error logging on migration failure
Signed-off-by: John Molakvoæ <skjnldsv@protonmail.com>
This commit is contained in:
parent
1e5a879d2e
commit
0257315c34
1 changed files with 2 additions and 4 deletions
|
|
@ -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.');
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue