This commit is contained in:
parent
f69ba1bf5c
commit
0c857398f1
1 changed files with 4 additions and 3 deletions
|
@ -144,12 +144,13 @@ class Doctrine_Export extends Doctrine_Connection_Module
|
||||||
}
|
}
|
||||||
|
|
||||||
$queryFields = $this->getFieldDeclarationList($fields);
|
$queryFields = $this->getFieldDeclarationList($fields);
|
||||||
|
/**
|
||||||
if (isset($options['foreignKeys']) && ! empty($options['foreignKeys'])) {
|
if (isset($options['foreignKeys']) && ! empty($options['foreignKeys'])) {
|
||||||
foreach($options['foreignKeys'] as $definition) {
|
foreach($options['foreignKeys'] as $definition) {
|
||||||
$queryFields .= ', ' . $this->getForeignKeyDeclaration($definition);
|
$queryFields .= ', ' . $this->getForeignKeyDeclaration($definition);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
|
|
||||||
if (isset($options['primary']) && ! empty($options['primary'])) {
|
if (isset($options['primary']) && ! empty($options['primary'])) {
|
||||||
$queryFields .= ', PRIMARY KEY(' . implode(', ', array_values($options['primary'])) . ')';
|
$queryFields .= ', PRIMARY KEY(' . implode(', ', array_values($options['primary'])) . ')';
|
||||||
|
@ -230,7 +231,7 @@ class Doctrine_Export extends Doctrine_Connection_Module
|
||||||
$name = $this->conn->quoteIdentifier($this->conn->formatter->getIndexName($name));
|
$name = $this->conn->quoteIdentifier($this->conn->formatter->getIndexName($name));
|
||||||
$query = 'ALTER TABLE ' . $table . ' ADD CONSTRAINT ' . $name;
|
$query = 'ALTER TABLE ' . $table . ' ADD CONSTRAINT ' . $name;
|
||||||
|
|
||||||
if (isset($definition['primary']) && $definition['unique']) {
|
if (isset($definition['primary']) && $definition['primary']) {
|
||||||
$query .= ' PRIMARY KEY';
|
$query .= ' PRIMARY KEY';
|
||||||
} elseif (isset($definition['unique']) && $definition['unique']) {
|
} elseif (isset($definition['unique']) && $definition['unique']) {
|
||||||
$query .= ' UNIQUE';
|
$query .= ' UNIQUE';
|
||||||
|
@ -700,7 +701,7 @@ class Doctrine_Export extends Doctrine_Connection_Module
|
||||||
$sql .= $keyword . $upper;
|
$sql .= $keyword . $upper;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
throw new Doctrine_Export_Exception('Unknown foreign key referential action option given.');
|
throw new Doctrine_Export_Exception('Unknown foreign key referential action \'' . $upper . '\' given.');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue