diff options
Diffstat (limited to 'lib/private/DB/MigrationService.php')
-rw-r--r-- | lib/private/DB/MigrationService.php | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/lib/private/DB/MigrationService.php b/lib/private/DB/MigrationService.php index 9c94cbc61fa..c1a6b82dccd 100644 --- a/lib/private/DB/MigrationService.php +++ b/lib/private/DB/MigrationService.php @@ -27,6 +27,7 @@ namespace OC\DB; +use Doctrine\DBAL\Exception\DriverException; use Doctrine\DBAL\Platforms\OraclePlatform; use Doctrine\DBAL\Platforms\PostgreSqlPlatform; use Doctrine\DBAL\Schema\Index; @@ -124,7 +125,7 @@ class MigrationService { return false; } - if ($this->connection->tableExists('migrations')) { + if ($this->connection->tableExists('migrations') && \OC::$server->getConfig()->getAppValue('core', 'vendor', '') !== 'owncloud') { $this->migrationTableCreated = true; return false; } @@ -421,7 +422,13 @@ class MigrationService { // read known migrations $toBeExecuted = $this->getMigrationsToExecute($to); foreach ($toBeExecuted as $version) { - $this->executeStep($version, $schemaOnly); + try { + $this->executeStep($version, $schemaOnly); + } catch (DriverException $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); + } } } |