@@ 479-492 (lines=14) @@ | ||
476 | * @group DBAL-50 |
|
477 | * @group DBAL-1063 |
|
478 | */ |
|
479 | public function testPrimaryKeyOverrulingUniqueIndexDoesNotDropUniqueIndex() |
|
480 | { |
|
481 | $table = new Table("bar"); |
|
482 | $table->addColumn('baz', 'integer', array()); |
|
483 | $table->addUniqueIndex(array('baz'), 'idx_unique'); |
|
484 | ||
485 | $table->setPrimaryKey(array('baz')); |
|
486 | ||
487 | $indexes = $table->getIndexes(); |
|
488 | $this->assertEquals(2, count($indexes), "Table should only contain both the primary key table index and the unique one, even though it was overruled."); |
|
489 | ||
490 | $this->assertTrue($table->hasPrimaryKey()); |
|
491 | $this->assertTrue($table->hasIndex('idx_unique')); |
|
492 | } |
|
493 | ||
494 | public function testAddingFulfillingRegularIndexOverridesImplicitForeignKeyConstraintIndex() |
|
495 | { |
@@ 253-265 (lines=13) @@ | ||
250 | /** |
|
251 | * @group DBAL-511 |
|
252 | */ |
|
253 | public function testDefaultValueCharacterVarying() |
|
254 | { |
|
255 | $testTable = new \Doctrine\DBAL\Schema\Table('dbal511_default'); |
|
256 | $testTable->addColumn('id', 'integer'); |
|
257 | $testTable->addColumn('def', 'string', array('default' => 'foo')); |
|
258 | $testTable->setPrimaryKey(array('id')); |
|
259 | ||
260 | $this->_sm->createTable($testTable); |
|
261 | ||
262 | $databaseTable = $this->_sm->listTableDetails($testTable->getName()); |
|
263 | ||
264 | $this->assertEquals('foo', $databaseTable->getColumn('def')->getDefault()); |
|
265 | } |
|
266 | ||
267 | /** |
|
268 | * @group DDC-2843 |