From d7d1c397a35735383b34632d3a67bbc3a3371a45 Mon Sep 17 00:00:00 2001 From: Guilherme Blanco Date: Sat, 24 Sep 2016 04:02:45 +0000 Subject: [PATCH] Removed identifier generator type from schema table definition --- lib/Doctrine/DBAL/Platforms/SqlitePlatform.php | 2 +- lib/Doctrine/DBAL/Schema/AbstractSchemaManager.php | 2 +- lib/Doctrine/DBAL/Schema/Table.php | 4 +--- .../Functional/Schema/SchemaManagerFunctionalTestCase.php | 4 ++-- tests/Doctrine/Tests/DBAL/Schema/TableTest.php | 2 +- 5 files changed, 6 insertions(+), 8 deletions(-) diff --git a/lib/Doctrine/DBAL/Platforms/SqlitePlatform.php b/lib/Doctrine/DBAL/Platforms/SqlitePlatform.php index f95486f69f6..a0af2c7e768 100644 --- a/lib/Doctrine/DBAL/Platforms/SqlitePlatform.php +++ b/lib/Doctrine/DBAL/Platforms/SqlitePlatform.php @@ -875,7 +875,7 @@ public function getAlterTableSQL(TableDiff $diff) if ( ! $this->onSchemaAlterTable($diff, $tableSql)) { $dataTable = new Table('__temp__'.$table->getName()); - $newTable = new Table($table->getQuotedName($this), $columns, $this->getPrimaryIndexInAlteredTable($diff), array(), $this->getForeignKeysInAlteredTable($diff), 0, $table->getOptions()); + $newTable = new Table($table->getQuotedName($this), $columns, $this->getPrimaryIndexInAlteredTable($diff), array(), $this->getForeignKeysInAlteredTable($diff), $table->getOptions()); $newTable->addOption('alter', true); $sql = $this->getPreAlterTableIndexForeignKeySQL($diff); diff --git a/lib/Doctrine/DBAL/Schema/AbstractSchemaManager.php b/lib/Doctrine/DBAL/Schema/AbstractSchemaManager.php index f1bb749b41b..6523ddb4060 100644 --- a/lib/Doctrine/DBAL/Schema/AbstractSchemaManager.php +++ b/lib/Doctrine/DBAL/Schema/AbstractSchemaManager.php @@ -287,7 +287,7 @@ public function listTableDetails($tableName) $indexes = $this->listTableIndexes($tableName); - return new Table($tableName, $columns, $indexes, [], $foreignKeys, false, []); + return new Table($tableName, $columns, $indexes, [], $foreignKeys, []); } /** diff --git a/lib/Doctrine/DBAL/Schema/Table.php b/lib/Doctrine/DBAL/Schema/Table.php index c62a74de614..47c12202092 100644 --- a/lib/Doctrine/DBAL/Schema/Table.php +++ b/lib/Doctrine/DBAL/Schema/Table.php @@ -83,7 +83,6 @@ class Table extends AbstractAsset * @param Index[] $indexes * @param UniqueConstraint[] $uniqueConstraints * @param ForeignKeyConstraint[] $fkConstraints - * @param integer $idGeneratorType * @param array $options * * @throws DBALException @@ -94,7 +93,6 @@ public function __construct( array $indexes = [], array $uniqueConstraints = [], array $fkConstraints = [], - $idGeneratorType = 0, array $options = [] ) { @@ -839,7 +837,7 @@ protected function _getMaxIdentifierLength() return ($this->_schemaConfig instanceof SchemaConfig) ? $this->_schemaConfig->getMaxIdentifierLength() : 63 - ; + ; } /** diff --git a/tests/Doctrine/Tests/DBAL/Functional/Schema/SchemaManagerFunctionalTestCase.php b/tests/Doctrine/Tests/DBAL/Functional/Schema/SchemaManagerFunctionalTestCase.php index 208f699b0aa..7156ea3d762 100644 --- a/tests/Doctrine/Tests/DBAL/Functional/Schema/SchemaManagerFunctionalTestCase.php +++ b/tests/Doctrine/Tests/DBAL/Functional/Schema/SchemaManagerFunctionalTestCase.php @@ -887,7 +887,7 @@ protected function createTestTable($name = 'test_table', $data = array()) protected function getTestTable($name, $options=array()) { - $table = new Table($name, array(), array(), array(), array(), false, $options); + $table = new Table($name, array(), array(), array(), array(), $options); $table->setSchemaConfig($this->_sm->createSchemaConfig()); $table->addColumn('id', 'integer', array('notnull' => true)); $table->setPrimaryKey(array('id')); @@ -898,7 +898,7 @@ protected function getTestTable($name, $options=array()) protected function getTestCompositeTable($name) { - $table = new Table($name, array(), array(), array(), array(), false, array()); + $table = new Table($name, array(), array(), array(), array(), array()); $table->setSchemaConfig($this->_sm->createSchemaConfig()); $table->addColumn('id', 'integer', array('notnull' => true)); $table->addColumn('other_id', 'integer', array('notnull' => true)); diff --git a/tests/Doctrine/Tests/DBAL/Schema/TableTest.php b/tests/Doctrine/Tests/DBAL/Schema/TableTest.php index 020dae79fab..c1e6865d250 100644 --- a/tests/Doctrine/Tests/DBAL/Schema/TableTest.php +++ b/tests/Doctrine/Tests/DBAL/Schema/TableTest.php @@ -203,7 +203,7 @@ public function testConstraints() public function testOptions() { - $table = new Table("foo", array(), array(), array(), array(), false, array("foo" => "bar")); + $table = new Table("foo", array(), array(), array(), array(), array("foo" => "bar")); self::assertTrue($table->hasOption("foo")); self::assertEquals("bar", $table->getOption("foo"));