diff --git a/adminer/foreign.inc.php b/adminer/foreign.inc.php index 7009a9fb..b9d91480 100644 --- a/adminer/foreign.inc.php +++ b/adminer/foreign.inc.php @@ -11,7 +11,7 @@ if ($_POST && !$error && !$_POST["add"] && !$_POST["change"] && !$_POST["change- $target[$key] = $_POST["target"][$key]; } query_redirect("ALTER TABLE " . table($TABLE) - . ($_GET["name"] != "" ? "\nDROP FOREIGN KEY " . idf_escape($_GET["name"]) . "," : "") + . ($_GET["name"] != "" ? "\nDROP " . ($jush == "sql" ? "FOREIGN KEY " : "CONSTRAINT ") . idf_escape($_GET["name"]) . "," : "") . "\nADD FOREIGN KEY (" . implode(", ", array_map('idf_escape', $source)) . ") REFERENCES " . table($_POST["table"]) . " (" . implode(", ", array_map('idf_escape', $target)) . ")" //! reuse $_GET["name"] - check in older MySQL versions . (ereg("^($on_actions)\$", $_POST["on_delete"]) ? " ON DELETE $_POST[on_delete]" : "") . (ereg("^($on_actions)\$", $_POST["on_update"]) ? " ON UPDATE $_POST[on_update]" : "") diff --git a/changes.txt b/changes.txt index e5dca750..5e9eee52 100644 --- a/changes.txt +++ b/changes.txt @@ -1,4 +1,5 @@ Adminer 3.3.4-dev: +PostgreSQL: fix alter foreign key PostgreSQL over PDO: connect if the eponymous database does not exist (bug #3391619) Boolean search (Editor) Persian translation