CleanUp in SchemaTool.
This commit is contained in:
parent
ad50327744
commit
ef50d940de
@ -132,13 +132,6 @@ class SchemaTool
|
|||||||
|
|
||||||
$table = $schema->createTable($class->getQuotedTableName($this->_platform));
|
$table = $schema->createTable($class->getQuotedTableName($this->_platform));
|
||||||
|
|
||||||
// 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
|
$columns = array(); // table columns
|
||||||
|
|
||||||
if ($class->isInheritanceTypeSingleTable()) {
|
if ($class->isInheritanceTypeSingleTable()) {
|
||||||
@ -189,10 +182,6 @@ class SchemaTool
|
|||||||
$table->getColumn($class->identifier[0])->setAutoincrement(false);
|
$table->getColumn($class->identifier[0])->setAutoincrement(false);
|
||||||
|
|
||||||
$pkColumns[] = $columnName;
|
$pkColumns[] = $columnName;
|
||||||
// TODO: REMOVE
|
|
||||||
/*if ($table->isIdGeneratorIdentity()) {
|
|
||||||
$table->setIdGeneratorType(\Doctrine\DBAL\Schema\Table::ID_NONE);
|
|
||||||
}*/
|
|
||||||
|
|
||||||
// Add a FK constraint on the ID column
|
// Add a FK constraint on the ID column
|
||||||
$table->addUnnamedForeignKeyConstraint(
|
$table->addUnnamedForeignKeyConstraint(
|
||||||
@ -347,6 +336,9 @@ class SchemaTool
|
|||||||
if ($class->isIdGeneratorIdentity() && $class->getIdentifierFieldNames() == array($mapping['fieldName'])) {
|
if ($class->isIdGeneratorIdentity() && $class->getIdentifierFieldNames() == array($mapping['fieldName'])) {
|
||||||
$options['autoincrement'] = true;
|
$options['autoincrement'] = true;
|
||||||
}
|
}
|
||||||
|
if ($class->isInheritanceTypeJoined() && $class->name != $class->rootEntityName) {
|
||||||
|
$options['autoincrement'] = false;
|
||||||
|
}
|
||||||
|
|
||||||
if ($table->hasColumn($columnName)) {
|
if ($table->hasColumn($columnName)) {
|
||||||
// required in some inheritance scenarios
|
// required in some inheritance scenarios
|
||||||
@ -502,7 +494,7 @@ class SchemaTool
|
|||||||
*/
|
*/
|
||||||
public function dropSchema(array $classes)
|
public function dropSchema(array $classes)
|
||||||
{
|
{
|
||||||
$dropSchemaSql = $this->getDropSchemaSql($classes);
|
$dropSchemaSql = $this->getDropSchemaSQL($classes);
|
||||||
$conn = $this->_em->getConnection();
|
$conn = $this->_em->getConnection();
|
||||||
|
|
||||||
foreach ($dropSchemaSql as $sql) {
|
foreach ($dropSchemaSql as $sql) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user