forked from doctrine/dbal
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'doctrine:3.6.x' into postgres-unlogged-tables-doctrine#…
- Loading branch information
Showing
9 changed files
with
164 additions
and
26 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
<?php | ||
|
||
namespace Doctrine\DBAL\Tests\Functional\Driver; | ||
|
||
use Doctrine\DBAL\Schema\Table; | ||
use Doctrine\DBAL\Tests\FunctionalTestCase; | ||
use Doctrine\DBAL\Tests\TestUtil; | ||
|
||
class DBAL6024Test extends FunctionalTestCase | ||
{ | ||
protected function setUp(): void | ||
{ | ||
if (TestUtil::isDriverOneOf('pdo_pgsql', 'pgsql')) { | ||
return; | ||
} | ||
|
||
self::markTestSkipped('This test requires the pdo_pgsql or the pgsql driver.'); | ||
} | ||
|
||
public function testDropPrimaryKey(): void | ||
{ | ||
$table = new Table('mytable'); | ||
$table->addColumn('id', 'integer'); | ||
$table->setPrimaryKey(['id']); | ||
$this->dropAndCreateTable($table); | ||
|
||
$newTable = clone $table; | ||
$newTable->dropPrimaryKey(); | ||
|
||
$schemaManager = $this->connection->createSchemaManager(); | ||
$diff = $schemaManager->createComparator()->compareTables($table, $newTable); | ||
|
||
$statements = $this->connection->getDatabasePlatform()->getAlterTableSQL($diff); | ||
foreach ($statements as $statement) { | ||
$this->connection->executeStatement($statement); | ||
} | ||
|
||
$validationSchema = $schemaManager->introspectSchema(); | ||
$validationTable = $validationSchema->getTable($table->getName()); | ||
|
||
$this->assertNull($validationTable->getPrimaryKey()); | ||
} | ||
} |
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