From: Vincent Vanwaelscappel Date: Thu, 20 Jan 2022 17:13:16 +0000 (+0100) Subject: wip #5041 X-Git-Url: http://git.cubedesigners.com/?a=commitdiff_plain;h=b111cc29a25702075a97f98e3fef0e39223d4139;p=cubist_cms-back.git wip #5041 --- diff --git a/src/app/Console/Commands/MigrateCommand.php b/src/app/Console/Commands/MigrateCommand.php index e802117..64888db 100644 --- a/src/app/Console/Commands/MigrateCommand.php +++ b/src/app/Console/Commands/MigrateCommand.php @@ -52,6 +52,7 @@ class MigrateCommand extends CubistMagicCommand 'dbname' => config($prefix . 'database'), ]; $this->line(print_r($params, true)); + $connection = DriverManager::getConnection($params); $connection->getDatabasePlatform()->registerDoctrineTypeMapping('enum', 'string'); $currentSchema = $connection->getSchemaManager()->createSchema(); @@ -81,9 +82,13 @@ class MigrateCommand extends CubistMagicCommand { $this->line('Handling ' . get_class($model)); - $res = $model->setSchema($this->_getSchema($model->getConnectionName())); - if (null !== $res) { - $this->line('-- Migrate ' . $res->getName()); + try { + $res = $model->setSchema($this->_getSchema($model->getConnectionName())); + if (null !== $res) { + $this->line('-- Migrate ' . $res->getName()); + } + }catch (\Exception $e){ + } }