mirror of
https://github.com/vrana/adminer.git
synced 2025-08-08 15:47:00 +02:00
Display collation at table structure if different from table
This commit is contained in:
@@ -1,4 +1,5 @@
|
|||||||
## Adminer dev
|
## Adminer dev
|
||||||
|
- Display collation at table structure if different from table
|
||||||
- PostgreSQL: Display auto_increment of inserted rows
|
- PostgreSQL: Display auto_increment of inserted rows
|
||||||
- PostgreSQL: Display description of system variables
|
- PostgreSQL: Display description of system variables
|
||||||
- PostgreSQL: Avoid warning about crdb_version (bug #924, regression from 5.0.5)
|
- PostgreSQL: Avoid warning about crdb_version (bug #924, regression from 5.0.5)
|
||||||
|
@@ -318,9 +318,10 @@ class Adminer {
|
|||||||
|
|
||||||
/** Print table structure in tabular format
|
/** Print table structure in tabular format
|
||||||
* @param array data about individual fields
|
* @param array data about individual fields
|
||||||
|
* @param array
|
||||||
* @return null
|
* @return null
|
||||||
*/
|
*/
|
||||||
function tableStructurePrint($fields) {
|
function tableStructurePrint($fields, $tableStatus = null) {
|
||||||
global $driver;
|
global $driver;
|
||||||
echo "<div class='scrollable'>\n";
|
echo "<div class='scrollable'>\n";
|
||||||
echo "<table class='nowrap odds'>\n";
|
echo "<table class='nowrap odds'>\n";
|
||||||
@@ -329,8 +330,11 @@ class Adminer {
|
|||||||
foreach ($fields as $field) {
|
foreach ($fields as $field) {
|
||||||
echo "<tr><th>" . h($field["field"]);
|
echo "<tr><th>" . h($field["field"]);
|
||||||
$type = h($field["full_type"]);
|
$type = h($field["full_type"]);
|
||||||
echo "<td><span title='" . h($field["collation"]) . "'>"
|
$collation = h($field["collation"]);
|
||||||
. (in_array($type, (array) $structured_types[lang('User types')]) ? "<a href='" . h(ME . 'type=' . urlencode($type)) . "'>$type</a>" : $type)
|
echo "<td><span title='$collation'>"
|
||||||
|
. (in_array($type, (array) $structured_types[lang('User types')])
|
||||||
|
? "<a href='" . h(ME . 'type=' . urlencode($type)) . "'>$type</a>"
|
||||||
|
: $type . ($collation && isset($tableStatus["Collation"]) && $collation != $tableStatus["Collation"] ? " $collation" : ""))
|
||||||
. "</span>"
|
. "</span>"
|
||||||
;
|
;
|
||||||
echo ($field["null"] ? " <i>NULL</i>" : "");
|
echo ($field["null"] ? " <i>NULL</i>" : "");
|
||||||
|
@@ -258,7 +258,7 @@ class Plugins extends Adminer {
|
|||||||
return $this->applyPlugin(__FUNCTION__, $args);
|
return $this->applyPlugin(__FUNCTION__, $args);
|
||||||
}
|
}
|
||||||
|
|
||||||
function tableStructurePrint($fields) {
|
function tableStructurePrint($fields, $tableStatus = null) {
|
||||||
$args = func_get_args();
|
$args = func_get_args();
|
||||||
return $this->applyPlugin(__FUNCTION__, $args);
|
return $this->applyPlugin(__FUNCTION__, $args);
|
||||||
}
|
}
|
||||||
|
@@ -6,7 +6,7 @@ $fields = fields($TABLE);
|
|||||||
if (!$fields) {
|
if (!$fields) {
|
||||||
$error = error();
|
$error = error();
|
||||||
}
|
}
|
||||||
$table_status = table_status1($TABLE, true);
|
$table_status = table_status1($TABLE);
|
||||||
$name = $adminer->tableName($table_status);
|
$name = $adminer->tableName($table_status);
|
||||||
|
|
||||||
page_header(($fields && is_view($table_status) ? $table_status['Engine'] == 'materialized view' ? lang('Materialized view') : lang('View') : lang('Table')) . ": " . ($name != "" ? $name : h($TABLE)), $error);
|
page_header(($fields && is_view($table_status) ? $table_status['Engine'] == 'materialized view' ? lang('Materialized view') : lang('View') : lang('Table')) . ": " . ($name != "" ? $name : h($TABLE)), $error);
|
||||||
@@ -23,7 +23,7 @@ if ($comment != "") {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if ($fields) {
|
if ($fields) {
|
||||||
$adminer->tableStructurePrint($fields);
|
$adminer->tableStructurePrint($fields, $table_status);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (support("indexes") && $driver->supportsIndex($table_status)) {
|
if (support("indexes") && $driver->supportsIndex($table_status)) {
|
||||||
|
2
externals/JsShrink
vendored
2
externals/JsShrink
vendored
Submodule externals/JsShrink updated: 18dcc3849a...4f8a69bd80
@@ -12,7 +12,7 @@ class AdminerTableStructure {
|
|||||||
* @param array data about individual fields
|
* @param array data about individual fields
|
||||||
* @return bool
|
* @return bool
|
||||||
*/
|
*/
|
||||||
function tableStructurePrint($fields) {
|
function tableStructurePrint($fields, $tableStatus = null) {
|
||||||
echo "<div class='scrollable'>\n";
|
echo "<div class='scrollable'>\n";
|
||||||
echo "<table class='nowrap odds'>\n";
|
echo "<table class='nowrap odds'>\n";
|
||||||
echo "<thead><tr>"
|
echo "<thead><tr>"
|
||||||
|
Reference in New Issue
Block a user