-
-
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.
Make compared tables order idempotent
- Loading branch information
1 parent
cff9542
commit 17f8d42
Showing
9 changed files
with
106 additions
and
6 deletions.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Doctrine\Migrations\Tests\Provider; | ||
|
||
class B | ||
{ | ||
/** @var int|null */ | ||
private $id; | ||
|
||
public function getId() : ?int | ||
{ | ||
return $this->id; | ||
} | ||
} |
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,16 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Doctrine\Migrations\Tests\Provider; | ||
|
||
class C | ||
{ | ||
/** @var int|null */ | ||
private $id; | ||
|
||
public function getId() : ?int | ||
{ | ||
return $this->id; | ||
} | ||
} |
20 changes: 20 additions & 0 deletions
20
tests/Doctrine/Migrations/Tests/Provider/ClassMetadataFactory.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,20 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Doctrine\Migrations\Tests\Provider; | ||
|
||
use Doctrine\Common\Persistence\Mapping\ClassMetadata; | ||
use Doctrine\ORM\Mapping\ClassMetadataFactory as BaseMetadataFactoryAlias; | ||
use function array_reverse; | ||
|
||
class ClassMetadataFactory extends BaseMetadataFactoryAlias | ||
{ | ||
/** | ||
* @return ClassMetadata[] | ||
*/ | ||
public function getAllMetadata() : array | ||
{ | ||
return array_reverse(parent::getAllMetadata()); | ||
} | ||
} |
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
12 changes: 12 additions & 0 deletions
12
tests/Doctrine/Migrations/Tests/Provider/_files/Doctrine.Migrations.Tests.Provider.B.dcm.xml
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,12 @@ | ||
<doctrine-mapping xmlns="http://doctrine-project.org/schemas/orm/doctrine-mapping" | ||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:schemaLocation="http://doctrine-project.org/schemas/orm/doctrine-mapping | ||
https://raw.github.com/doctrine/doctrine2/master/doctrine-mapping.xsd"> | ||
|
||
<entity name="Doctrine\Migrations\Tests\Provider\B" table="b"> | ||
<id name="id" type="integer" column="id"> | ||
<generator strategy="AUTO" /> | ||
</id> | ||
</entity> | ||
|
||
</doctrine-mapping> |
12 changes: 12 additions & 0 deletions
12
tests/Doctrine/Migrations/Tests/Provider/_files/Doctrine.Migrations.Tests.Provider.C.dcm.xml
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,12 @@ | ||
<doctrine-mapping xmlns="http://doctrine-project.org/schemas/orm/doctrine-mapping" | ||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:schemaLocation="http://doctrine-project.org/schemas/orm/doctrine-mapping | ||
https://raw.github.com/doctrine/doctrine2/master/doctrine-mapping.xsd"> | ||
|
||
<entity name="Doctrine\Migrations\Tests\Provider\C" table="c"> | ||
<id name="id" type="integer" column="id"> | ||
<generator strategy="AUTO" /> | ||
</id> | ||
</entity> | ||
|
||
</doctrine-mapping> |