|
2 | 2 |
|
3 | 3 | namespace Illuminate\Database\Migrations;
|
4 | 4 |
|
| 5 | +use Doctrine\DBAL\Schema\SchemaException; |
5 | 6 | use Illuminate\Contracts\Events\Dispatcher;
|
6 | 7 | use Illuminate\Database\ConnectionResolverInterface as Resolver;
|
7 | 8 | use Illuminate\Database\Events\MigrationEnded;
|
@@ -411,16 +412,22 @@ protected function runMigration($migration, $method)
|
411 | 412 | */
|
412 | 413 | protected function pretendToRun($migration, $method)
|
413 | 414 | {
|
414 |
| - foreach ($this->getQueries($migration, $method) as $query) { |
415 |
| - $name = get_class($migration); |
| 415 | + try { |
| 416 | + foreach ($this->getQueries($migration, $method) as $query) { |
| 417 | + $name = get_class($migration); |
| 418 | + |
| 419 | + $reflectionClass = new ReflectionClass($migration); |
416 | 420 |
|
417 |
| - $reflectionClass = new ReflectionClass($migration); |
| 421 | + if ($reflectionClass->isAnonymous()) { |
| 422 | + $name = $this->getMigrationName($reflectionClass->getFileName()); |
| 423 | + } |
418 | 424 |
|
419 |
| - if ($reflectionClass->isAnonymous()) { |
420 |
| - $name = $this->getMigrationName($reflectionClass->getFileName()); |
| 425 | + $this->note("<info>{$name}:</info> {$query['query']}"); |
421 | 426 | }
|
| 427 | + } catch (SchemaException $e) { |
| 428 | + $name = get_class($migration); |
422 | 429 |
|
423 |
| - $this->note("<info>{$name}:</info> {$query['query']}"); |
| 430 | + $this->note("<info>{$name}:</info> failed to dump queries. This may be due to changing database columns using Doctrine, which is not supported while pretending to run migrations."); |
424 | 431 | }
|
425 | 432 | }
|
426 | 433 |
|
|
0 commit comments