Commit 1104ae70 authored by zYne's avatar zYne

primary keys now unsigned by default, primary keys no longer used as foreign keys

parent 4865602e
...@@ -228,7 +228,8 @@ class Doctrine_Table extends Doctrine_Configurable implements Countable ...@@ -228,7 +228,8 @@ class Doctrine_Table extends Doctrine_Configurable implements Countable
array('integer', array('integer',
20, 20,
array('autoincrement' => true, array('autoincrement' => true,
'primary' => true 'primary' => true,
'unsigned' => true,
) )
) )
), $this->columns); ), $this->columns);
...@@ -367,6 +368,10 @@ class Doctrine_Table extends Doctrine_Configurable implements Countable ...@@ -367,6 +368,10 @@ class Doctrine_Table extends Doctrine_Configurable implements Countable
$fk = $relation->toArray(); $fk = $relation->toArray();
$fk['foreignTable'] = $relation->getTable()->getTableName(); $fk['foreignTable'] = $relation->getTable()->getTableName();
if ($relation->getTable() === $this && in_array($relation->getLocal(), $primary)) {
continue;
}
if ($relation->hasConstraint()) { if ($relation->hasConstraint()) {
$options['foreignKeys'][] = $fk; $options['foreignKeys'][] = $fk;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment