Fix dropping foreign keys linking to other database
This commit is contained in:
parent
a7cbf66347
commit
0cd02bb98a
|
@ -7,6 +7,7 @@ if ($_POST && !$error && !$_POST["add"] && !$_POST["change"] && !$_POST["change-
|
|||
$message = ($_POST["drop"] ? lang('Foreign key has been dropped.') : ($name != "" ? lang('Foreign key has been altered.') : lang('Foreign key has been created.')));
|
||||
$location = ME . "table=" . urlencode($TABLE);
|
||||
|
||||
if (!$_POST["drop"]) {
|
||||
$row["source"] = array_filter($row["source"], 'strlen');
|
||||
ksort($row["source"]); // enforce input order
|
||||
$target = array();
|
||||
|
@ -14,6 +15,7 @@ if ($_POST && !$error && !$_POST["add"] && !$_POST["change"] && !$_POST["change-
|
|||
$target[$key] = $row["target"][$key];
|
||||
}
|
||||
$row["target"] = $target;
|
||||
}
|
||||
|
||||
if ($jush == "sqlite") {
|
||||
queries_redirect($location, $message, recreate_table($TABLE, $TABLE, array(), array(), array(" $name" => ($_POST["drop"] ? "" : " " . format_foreign_key($row)))));
|
||||
|
|
Loading…
Reference in a new issue