mirror of
https://github.com/vrana/adminer.git
synced 2025-08-07 23:27:17 +02:00
PostgreSQL: fix alter foreign key
This commit is contained in:
@@ -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]" : "")
|
||||
|
Reference in New Issue
Block a user