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

Descending indexes

This commit is contained in:
Jakub Vrana
2013-06-25 09:42:47 -07:00
parent c8248bb19c
commit 5f370927f1
10 changed files with 57 additions and 25 deletions

View File

@@ -305,11 +305,14 @@ if (isset($_GET["sqlite"]) || isset($_GET["sqlite2"])) {
$return[""] = array("type" => "PRIMARY", "columns" => $primary, "lengths" => array());
}
foreach (get_rows("PRAGMA index_list(" . table($table) . ")") as $row) {
if (!ereg("^sqlite_", $row["name"])) {
$return[$row["name"]]["type"] = ($row["unique"] ? "UNIQUE" : "INDEX");
$return[$row["name"]]["lengths"] = array();
foreach (get_rows("PRAGMA index_info(" . idf_escape($row["name"]) . ")") as $row1) {
$return[$row["name"]]["columns"][] = $row1["name"];
$name = $row["name"];
if (!ereg("^sqlite_", $name)) {
$return[$name]["type"] = ($row["unique"] ? "UNIQUE" : "INDEX");
$return[$name]["lengths"] = array();
$return[$name]["descs"] = array();
foreach (get_rows("PRAGMA index_info(" . idf_escape($name) . ")") as $row1) {
$return[$name]["columns"][] = $row1["name"];
$return[$name]["descs"][] = null; // information about DESC is not available anywhere
}
}
}