mirror of
https://github.com/vrana/adminer.git
synced 2025-08-10 00:28:34 +02:00
Fix dropping foreign keys linking to other database
This commit is contained in:
@@ -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)))));
|
||||
|
Reference in New Issue
Block a user