Separate types to groups in table creation

git-svn-id: https://adminer.svn.sourceforge.net/svnroot/adminer/trunk@828 7c3ca157-0c34-0410-bff1-cbf682f78f5c
This commit is contained in:
jakubvrana 2009-07-14 16:16:12 +00:00
parent d2ba5938c5
commit 26b07bf761
4 changed files with 26 additions and 12 deletions

View file

@ -18,9 +18,9 @@ function referencable_primary($self) {
}
function edit_type($key, $field, $collations, $foreign_keys = array()) {
global $types, $unsigned, $inout;
global $structured_types, $unsigned, $inout;
?>
<td><select name="<?php echo $key; ?>[type]" onchange="editing_type_change(this);"><?php echo optionlist(array_keys($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($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><?php
echo "<select name=\"$key" . '[collation]"' . (ereg('(char|text|enum|set)$', $field["type"]) ? "" : " class='hidden'") . '><option value="">(' . lang('collation') . ')' . optionlist($collations, $field["collation"]) . '</select>';

View file

@ -342,14 +342,16 @@ function information_schema($db) {
}
// value means maximum unsigned length
$types = array(
"tinyint" => 3, "smallint" => 5, "mediumint" => 8, "int" => 10, "bigint" => 20,
"float" => 12, "double" => 21, "decimal" => 66,
"date" => 10, "datetime" => 19, "timestamp" => 19, "time" => 10, "year" => 4,
"char" => 255, "varchar" => 65535,
"binary" => 255, "varbinary" => 65535,
"tinytext" => 255, "text" => 65535, "mediumtext" => 16777215, "longtext" => 4294967295,
"tinyblob" => 255, "blob" => 65535, "mediumblob" => 16777215, "longblob" => 4294967295,
"enum" => 65535, "set" => 64,
);
$types = array();
$structured_types = array();
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;
$structured_types[$key] = array_keys($val);
}
$unsigned = array("unsigned", "zerofill", "unsigned zerofill");

View file

@ -222,4 +222,9 @@ $translations = array(
'Send' => 'Odeslat',
'%d e-mail(s) have been sent.' => array('Byl odeslán %d e-mail.', 'Byly odeslány %d e-maily.', 'Bylo odesláno %d e-mailů.'),
'Run file' => 'Spustit soubor',
'Numbers' => 'Čísla',
'Date and time' => 'Datum a čas',
'Strings' => 'Řetězce',
'Binary' => 'Binární',
'Lists' => 'Seznamy',
);

View file

@ -3,6 +3,13 @@ Editor: User friendly data editor
Customization: Adminer class
E-mail sending
Create single column foreign key in table structure
Separate types to groups in table creation
Show type in field name title (thanks to Jakub Sochor)
Preselect now() for timestamp columns (thanks to paranoiq)
Faster multiple update, clone and delete
Use HTML Strict instead of XHTML
Fixed grant ALL PRIVILEGES with GRANT OPTION
Fixed CSV import
Adminer 1.11.1 (released 2009-07-03):
Fix problem with enabled Filter extension