mirror of
https://github.com/vrana/adminer.git
synced 2025-08-08 07:36:44 +02:00
SQLite: Show primary key when altering indexes
This commit is contained in:
@@ -318,7 +318,7 @@ if (isset($_GET["sqlite"]) || isset($_GET["sqlite2"])) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
if ($primary) {
|
if ($primary) {
|
||||||
$return[""] = array("type" => "PRIMARY", "columns" => $primary, "lengths" => array());
|
$return[""] = array("type" => "PRIMARY", "columns" => $primary, "lengths" => array()); //! column order, descending
|
||||||
}
|
}
|
||||||
$sqls = get_key_vals("SELECT name, sql FROM sqlite_master WHERE type = 'index' AND tbl_name = " . q($table));
|
$sqls = get_key_vals("SELECT name, sql FROM sqlite_master WHERE type = 'index' AND tbl_name = " . q($table));
|
||||||
foreach (get_rows("PRAGMA index_list(" . table($table) . ")") as $row) {
|
foreach (get_rows("PRAGMA index_list(" . table($table) . ")") as $row) {
|
||||||
|
@@ -6,7 +6,9 @@ if (preg_match('~MyISAM|M?aria' . ($connection->server_info >= 5.6 ? '|InnoDB' :
|
|||||||
$index_types[] = "FULLTEXT";
|
$index_types[] = "FULLTEXT";
|
||||||
}
|
}
|
||||||
$indexes = indexes($TABLE);
|
$indexes = indexes($TABLE);
|
||||||
|
$primary = array();
|
||||||
if ($jush == "sqlite") { // doesn't support primary key
|
if ($jush == "sqlite") { // doesn't support primary key
|
||||||
|
$primary = $indexes[""];
|
||||||
unset($index_types[0]);
|
unset($index_types[0]);
|
||||||
unset($indexes[""]);
|
unset($indexes[""]);
|
||||||
}
|
}
|
||||||
@@ -97,6 +99,14 @@ if (!$row) {
|
|||||||
<th><noscript><input type='image' class='icon' name='add[0]' src='../adminer/static/plus.gif' alt='+' title='<?php echo lang('Add next'); ?>'></noscript>
|
<th><noscript><input type='image' class='icon' name='add[0]' src='../adminer/static/plus.gif' alt='+' title='<?php echo lang('Add next'); ?>'></noscript>
|
||||||
</thead>
|
</thead>
|
||||||
<?php
|
<?php
|
||||||
|
if ($primary) {
|
||||||
|
echo "<tr><td>PRIMARY<td>";
|
||||||
|
foreach ($primary["columns"] as $key => $column) {
|
||||||
|
echo "<select disabled>" . optionlist($fields, $column) . "</select>";
|
||||||
|
echo "<label><input disabled type='checkbox'>" . lang('descending') . "</label> ";
|
||||||
|
}
|
||||||
|
echo "<td><td>\n";
|
||||||
|
}
|
||||||
$j = 1;
|
$j = 1;
|
||||||
foreach ($row["indexes"] as $index) {
|
foreach ($row["indexes"] as $index) {
|
||||||
if (!$_POST["drop_col"] || $j != key($_POST["drop_col"])) {
|
if (!$_POST["drop_col"] || $j != key($_POST["drop_col"])) {
|
||||||
|
Reference in New Issue
Block a user