diff --git a/adminer/foreign.inc.php b/adminer/foreign.inc.php index f6e84f9d..c92f7e6b 100644 --- a/adminer/foreign.inc.php +++ b/adminer/foreign.inc.php @@ -12,7 +12,7 @@ if ($_POST && !$error && !$_POST["add"] && !$_POST["change"] && !$_POST["change- } query_redirect("ALTER TABLE " . table($TABLE) . ($_GET["name"] != "" ? "\nDROP FOREIGN KEY " . idf_escape($_GET["name"]) . "," : "") - . "\nADD FOREIGN KEY (" . implode(", ", array_map('idf_escape', $source)) . ") REFERENCES " . table($_POST["table"]) . " (" . implode(", ", array_map('idf_escape', $target)) . ")" + . "\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 . (in_array($_POST["on_delete"], $on_actions) ? " ON DELETE $_POST[on_delete]" : "") . (in_array($_POST["on_update"], $on_actions) ? " ON UPDATE $_POST[on_update]" : "") , ME . "table=" . urlencode($TABLE), ($_GET["name"] != "" ? lang('Foreign key has been altered.') : lang('Foreign key has been created.'))); diff --git a/todo.txt b/todo.txt index bcefcdac..aabcb778 100644 --- a/todo.txt +++ b/todo.txt @@ -10,6 +10,7 @@ Only first part of big BZ2 export is readable, files are missing in TAR Double click in select - Esc to abort editation Draggable columns in alter table (thanks to Michal Manak)