]> _ Git - cubist_cms-back.git/commitdiff
wip #5041
authorVincent Vanwaelscappel <vincent@cubedesigners.com>
Thu, 20 Jan 2022 17:13:16 +0000 (18:13 +0100)
committerVincent Vanwaelscappel <vincent@cubedesigners.com>
Thu, 20 Jan 2022 17:13:16 +0000 (18:13 +0100)
src/app/Console/Commands/MigrateCommand.php

index e802117293ec38dfd70c5a70c13e8574c6b4b255..64888db0f071ca3beb670dcc67a4eefdff899938 100644 (file)
@@ -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){
+
         }
     }