Separate type group description
git-svn-id: https://adminer.svn.sourceforge.net/svnroot/adminer/trunk@864 7c3ca157-0c34-0410-bff1-cbf682f78f5c
This commit is contained in:
parent
02054404ad
commit
ee91d5642b
|
@ -20,7 +20,7 @@ function referencable_primary($self) {
|
||||||
function edit_type($key, $field, $collations, $foreign_keys = array()) {
|
function edit_type($key, $field, $collations, $foreign_keys = array()) {
|
||||||
global $structured_types, $unsigned, $inout;
|
global $structured_types, $unsigned, $inout;
|
||||||
?>
|
?>
|
||||||
<td><select name="<?php echo $key; ?>[type]" onchange="editing_type_change(this);"><?php echo optionlist($structured_types + ($foreign_keys ? array(lang('Foreign keys') => $foreign_keys) : array()), $field["type"]); ?></select>
|
<td><select name="<?php echo $key; ?>[type]" onchange="editing_type_change(this);"><?php echo optionlist(array_combine(array(lang('Numbers'), lang('Date and time'), lang('Strings'), lang('Binary'), lang('Lists')), array_map('array_keys', $structured_types)) + ($foreign_keys ? array(lang('Foreign keys') => $foreign_keys) : array()), $field["type"]); ?></select>
|
||||||
<td><input name="<?php echo $key; ?>[length]" value="<?php echo htmlspecialchars($field["length"]); ?>" size="3">
|
<td><input name="<?php echo $key; ?>[length]" value="<?php echo htmlspecialchars($field["length"]); ?>" size="3">
|
||||||
<td><?php
|
<td><?php
|
||||||
echo "<select name=\"$key" . '[collation]"' . (ereg('(char|text|enum|set)$', $field["type"]) ? "" : " class='hidden'") . '><option value="">(' . lang('collation') . ')' . optionlist($collations, $field["collation"]) . '</select>';
|
echo "<select name=\"$key" . '[collation]"' . (ereg('(char|text|enum|set)$', $field["type"]) ? "" : " class='hidden'") . '><option value="">(' . lang('collation') . ')' . optionlist($collations, $field["collation"]) . '</select>';
|
||||||
|
|
|
@ -340,16 +340,15 @@ function information_schema($db) {
|
||||||
}
|
}
|
||||||
|
|
||||||
// value means maximum unsigned length
|
// value means maximum unsigned length
|
||||||
|
$structured_types = array(
|
||||||
|
array("tinyint" => 3, "smallint" => 5, "mediumint" => 8, "int" => 10, "bigint" => 20, "float" => 12, "double" => 21, "decimal" => 66),
|
||||||
|
array("date" => 10, "datetime" => 19, "timestamp" => 19, "time" => 10, "year" => 4),
|
||||||
|
array("char" => 255, "varchar" => 65535, "tinytext" => 255, "text" => 65535, "mediumtext" => 16777215, "longtext" => 4294967295),
|
||||||
|
array("binary" => 255, "varbinary" => 65535, "tinyblob" => 255, "blob" => 65535, "mediumblob" => 16777215, "longblob" => 4294967295),
|
||||||
|
array("enum" => 65535, "set" => 64),
|
||||||
|
);
|
||||||
$types = array();
|
$types = array();
|
||||||
$structured_types = array();
|
foreach ($structured_types as $val) {
|
||||||
foreach (array(
|
|
||||||
lang('Numbers') => array("tinyint" => 3, "smallint" => 5, "mediumint" => 8, "int" => 10, "bigint" => 20, "float" => 12, "double" => 21, "decimal" => 66),
|
|
||||||
lang('Date and time') => array("date" => 10, "datetime" => 19, "timestamp" => 19, "time" => 10, "year" => 4),
|
|
||||||
lang('Strings') => array("char" => 255, "varchar" => 65535, "tinytext" => 255, "text" => 65535, "mediumtext" => 16777215, "longtext" => 4294967295),
|
|
||||||
lang('Binary') => array("binary" => 255, "varbinary" => 65535, "tinyblob" => 255, "blob" => 65535, "mediumblob" => 16777215, "longblob" => 4294967295),
|
|
||||||
lang('Lists') => array("enum" => 65535, "set" => 64),
|
|
||||||
) as $key => $val) {
|
|
||||||
$types += $val;
|
$types += $val;
|
||||||
$structured_types[$key] = array_keys($val);
|
|
||||||
}
|
}
|
||||||
$unsigned = array("unsigned", "zerofill", "unsigned zerofill");
|
$unsigned = array("unsigned", "zerofill", "unsigned zerofill");
|
||||||
|
|
Loading…
Reference in a new issue