diff --git a/lib/Doctrine/ORM/Tools/SchemaTool.php b/lib/Doctrine/ORM/Tools/SchemaTool.php index 52942ead7..9d68f7c2d 100644 --- a/lib/Doctrine/ORM/Tools/SchemaTool.php +++ b/lib/Doctrine/ORM/Tools/SchemaTool.php @@ -117,11 +117,12 @@ class SchemaTool $table = $schema->createTable($class->getQuotedTableName($this->_platform)); - if ($class->isIdGeneratorIdentity()) { + // TODO: Remove + /**if ($class->isIdGeneratorIdentity()) { $table->setIdGeneratorType(\Doctrine\DBAL\Schema\Table::ID_IDENTITY); } else if ($class->isIdGeneratorSequence()) { $table->setIdGeneratorType(\Doctrine\DBAL\Schema\Table::ID_SEQUENCE); - } + }*/ $columns = array(); // table columns @@ -171,9 +172,10 @@ class SchemaTool $columnName = $class->getQuotedColumnName($class->identifier[0], $this->_platform); $pkColumns[] = $columnName; - if ($table->isIdGeneratorIdentity()) { + // TODO: REMOVE + /*if ($table->isIdGeneratorIdentity()) { $table->setIdGeneratorType(\Doctrine\DBAL\Schema\Table::ID_NONE); - } + }*/ // Add a FK constraint on the ID column $table->addUnnamedForeignKeyConstraint( @@ -322,6 +324,10 @@ class SchemaTool $options['columnDefinition'] = $mapping['columnDefinition']; } + if ($class->isIdGeneratorIdentity() && $class->getIdentifierFieldNames() == array($mapping['fieldName'])) { + $options['autoincrement'] = true; + } + if ($table->hasColumn($columnName)) { // required in some inheritance scenarios $table->changeColumn($columnName, $options); diff --git a/lib/vendor/doctrine-dbal b/lib/vendor/doctrine-dbal index 1142739e1..ce1e5f0f9 160000 --- a/lib/vendor/doctrine-dbal +++ b/lib/vendor/doctrine-dbal @@ -1 +1 @@ -Subproject commit 1142739e17f495adc7563c1bb18eab7f3465a231 +Subproject commit ce1e5f0f9c4f2e8894e1d2036ab11cc0597dd0a4