1
0
mirror of https://github.com/vrana/adminer.git synced 2025-08-08 07:36:44 +02:00

SQLite: Allow editing foreign keys

This commit is contained in:
Jakub Vrana
2013-08-09 15:16:15 -07:00
parent 62e582456e
commit 8a1b8910c1
6 changed files with 61 additions and 44 deletions

View File

@@ -58,7 +58,12 @@ if ($_POST && !process_fields($row["fields"]) && !$error) {
}
}
if ($foreign_key !== null) {
$foreign[idf_escape($field["field"])] = ($TABLE != "" && $jush != "sqlite" ? "ADD" : " ") . " FOREIGN KEY (" . idf_escape($field["field"]) . ") REFERENCES " . table($foreign_keys[$field["type"]]) . " (" . idf_escape($type_field["field"]) . ")" . (preg_match("~^($on_actions)\$~", $field["on_delete"]) ? " ON DELETE $field[on_delete]" : "");
$foreign[idf_escape($field["field"])] = ($TABLE != "" && $jush != "sqlite" ? "ADD" : " ") . format_foreign_key(array(
'table' => $foreign_keys[$field["type"]],
'source' => array($field["field"]),
'target' => array($type_field["field"]),
'on_delete' => $field["on_delete"],
));
}
$after = " AFTER " . idf_escape($field["field"]);
} elseif ($field["orig"] != "") {