Skip to content

Commit

Permalink
fixes unknown hash index errors when working with unique and overlapp…
Browse files Browse the repository at this point in the history
…ing foreign keys in postgres
  • Loading branch information
Jonas Hartmann authored and markstory committed May 7, 2016
1 parent b01ae5c commit 9b57973
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/Database/Schema/Table.php
Expand Up @@ -603,10 +603,12 @@ public function addConstraint($name, $attrs)
$attrs['columns']
));

$this->_constraints[$name]['references'][1] = array_unique(array_merge(
(array)$this->_constraints[$name]['references'][1],
[$attrs['references'][1]]
));
if (isset($this->_constraints[$name]['references'])) {
$this->_constraints[$name]['references'][1] = array_unique(array_merge(
(array)$this->_constraints[$name]['references'][1],
[$attrs['references'][1]]
));
}
return $this;
}
} else {
Expand Down

0 comments on commit 9b57973

Please sign in to comment.