X-Git-Url: http://git.inspyration.org/?a=blobdiff_plain;f=vendor%2Fdoctrine%2Fdbal%2Ftests%2FDoctrine%2FTests%2FDBAL%2FFunctional%2FSchema%2FMySqlSchemaManagerTest.php;fp=vendor%2Fdoctrine%2Fdbal%2Ftests%2FDoctrine%2FTests%2FDBAL%2FFunctional%2FSchema%2FMySqlSchemaManagerTest.php;h=ddbfc63e586368af2f2ca0d92788de16e521c478;hb=8b04b2d11798dee4f3e1358e4f43e97a6df851f6;hp=0000000000000000000000000000000000000000;hpb=73568cf05a785a45f94ca3f2351d9e07bf917958;p=zf2.biz%2Fgalerie.git diff --git a/vendor/doctrine/dbal/tests/Doctrine/Tests/DBAL/Functional/Schema/MySqlSchemaManagerTest.php b/vendor/doctrine/dbal/tests/Doctrine/Tests/DBAL/Functional/Schema/MySqlSchemaManagerTest.php new file mode 100644 index 0000000..ddbfc63 --- /dev/null +++ b/vendor/doctrine/dbal/tests/Doctrine/Tests/DBAL/Functional/Schema/MySqlSchemaManagerTest.php @@ -0,0 +1,50 @@ +addColumn('foo_id', 'integer'); + $tableOld->addColumn('bar_id', 'integer'); + $tableNew = clone $tableOld; + + $this->_sm->createTable($tableOld); + $tableFetched = $this->_sm->listTableDetails("switch_primary_key_columns"); + $tableNew = clone $tableFetched; + $tableNew->setPrimaryKey(array('bar_id', 'foo_id')); + + $comparator = new \Doctrine\DBAL\Schema\Comparator; + $this->_sm->alterTable($comparator->diffTable($tableFetched, $tableNew)); + } + + public function testDiffTableBug() + { + $schema = new Schema(); + $table = $schema->createTable('diffbug_routing_translations'); + $table->addColumn('id', 'integer'); + $table->addColumn('route', 'string'); + $table->addColumn('locale', 'string'); + $table->addColumn('attribute', 'string'); + $table->addColumn('localized_value', 'string'); + $table->addColumn('original_value', 'string'); + $table->setPrimaryKey(array('id')); + $table->addUniqueIndex(array('route', 'locale', 'attribute')); + $table->addIndex(array('localized_value')); // this is much more selective than the unique index + + $this->_sm->createTable($table); + $tableFetched = $this->_sm->listTableDetails("diffbug_routing_translations"); + + $comparator = new \Doctrine\DBAL\Schema\Comparator; + $diff = $comparator->diffTable($tableFetched, $table); + + $this->assertFalse($diff, "no changes expected."); + } +} \ No newline at end of file