Dblayeroo : when creating the tables, if the foreign keys are an object, do not crash
This commit is contained in:
@@ -519,6 +519,9 @@ class Dblayeroo
|
||||
$field = implode($this->sep . "," . $this->sep, $field);
|
||||
$k[1] = explode(",", $k[1]);
|
||||
$k[1] = implode($this->sep . "," . $this->sep, $k[1]);
|
||||
if (is_object($k[0])) {
|
||||
$k[0] = $k[0]->table;
|
||||
}
|
||||
$sql .= ",\n FOREIGN KEY($this->sep$field$this->sep) " .
|
||||
"REFERENCES $this->sep" . $k[0] . "$this->sep($this->sep" .
|
||||
$k[1] . "$this->sep)";
|
||||
@@ -632,6 +635,9 @@ class Dblayeroo
|
||||
$field = implode($this->sep . "," . $this->sep, $field);
|
||||
$k[1] = explode(",", $k[1]);
|
||||
$k[1] = implode($this->sep . "," . $this->sep, $k[1]);
|
||||
if (is_object($k[0])) {
|
||||
$k[0] = $k[0]->table;
|
||||
}
|
||||
$sql .= ",\n FOREIGN KEY($this->sep$field$this->sep) " .
|
||||
"REFERENCES $this->sep" . $k[0] . "$this->sep($this->sep" .
|
||||
$k[1] . "$this->sep)";
|
||||
@@ -745,6 +751,9 @@ class Dblayeroo
|
||||
$field = implode($this->sep . "," . $this->sep, $field);
|
||||
$k[1] = explode(",", $k[1]);
|
||||
$k[1] = implode($this->sep . "," . $this->sep, $k[1]);
|
||||
if (is_object($k[0])) {
|
||||
$k[0] = $k[0]->table;
|
||||
}
|
||||
$sql .= ",\n FOREIGN KEY(\"$field\") REFERENCES \"" . $k[0] . "\"(\"" .
|
||||
$k[1] . "\")";
|
||||
if (isset($k[2])) {
|
||||
|
||||
Reference in New Issue
Block a user