-
-
Notifications
You must be signed in to change notification settings - Fork 391
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #809 from doctrine/fix-dry-run-write-sql
Fix for referencing tables created during a dry run
- Loading branch information
Showing
8 changed files
with
143 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
22 changes: 22 additions & 0 deletions
22
tests/Doctrine/Migrations/Tests/Stub/Functional/DryRun/DryRun1.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Doctrine\Migrations\Tests\Stub\Functional\DryRun; | ||
|
||
use Doctrine\DBAL\Schema\Schema; | ||
use Doctrine\Migrations\AbstractMigration; | ||
|
||
class DryRun1 extends AbstractMigration | ||
{ | ||
public function up(Schema $schema) : void | ||
{ | ||
$table = $schema->createTable('foo'); | ||
$table->addColumn('id', 'integer'); | ||
} | ||
|
||
public function down(Schema $schema) : void | ||
{ | ||
$schema->dropTable('foo'); | ||
} | ||
} |
23 changes: 23 additions & 0 deletions
23
tests/Doctrine/Migrations/Tests/Stub/Functional/DryRun/DryRun2.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Doctrine\Migrations\Tests\Stub\Functional\DryRun; | ||
|
||
use Doctrine\DBAL\Schema\Schema; | ||
use Doctrine\Migrations\AbstractMigration; | ||
|
||
class DryRun2 extends AbstractMigration | ||
{ | ||
public function up(Schema $schema) : void | ||
{ | ||
$table = $schema->getTable('foo'); | ||
$table->addColumn('bar', 'string', ['notnull' => false]); | ||
} | ||
|
||
public function down(Schema $schema) : void | ||
{ | ||
$table = $schema->getTable('foo'); | ||
$table->dropColumn('bar'); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters