Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[DDC-1657] Prevent autoincrement sequences from creating DROP SEQUENC…
…E statements because of old/new schema missmatch.
- Loading branch information
Showing
7 changed files
with
110 additions
and
4 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
<?php | ||
|
||
namespace Doctrine\Tests\DBAL\Schema; | ||
|
||
use Doctrine\DBAL\Schema\Table; | ||
use Doctrine\DBAL\Schema\Sequence; | ||
|
||
class SequenceTest extends \Doctrine\Tests\DbalTestCase | ||
{ | ||
/** | ||
* @group DDC-1657 | ||
*/ | ||
public function testIsAutoincrementFor() | ||
{ | ||
$table = new Table("foo"); | ||
$table->addColumn("id", "integer", array("autoincrement" => true)); | ||
$table->setPrimaryKey(array("id")); | ||
|
||
$sequence = new Sequence("foo_id_seq"); | ||
$sequence2 = new Sequence("bar_id_seq"); | ||
$sequence3 = new Sequence("other.foo_id_seq"); | ||
|
||
$this->assertTrue($sequence->isAutoIncrementsFor($table)); | ||
$this->assertFalse($sequence2->isAutoIncrementsFor($table)); | ||
$this->assertFalse($sequence3->isAutoIncrementsFor($table)); | ||
} | ||
} | ||
|
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