This commit is contained in:
Jamie Cameron
2013-01-11 14:12:36 -08:00
parent c7f61dce04
commit a9a3f0b2af
2 changed files with 14 additions and 6 deletions
+10 -4
View File
@@ -79,9 +79,11 @@ else {
if ($type =~ /int$/) {
# Display unsigned/zerofill option
$opts = $extra =~ /unsigned/ ? 'unsigned' :
$extra =~ /zerofill/ ? 'zerofill' : '';
print &ui_hidden("oldopts", $opts);
print &ui_table_row($text{'field_opts'},
&ui_radio("opts", $extra =~ /unsigned/ ? 'unsigned' :
$extra =~ /zerofill/ ? 'zerofill' : '',
&ui_radio("opts", $opts,
[ [ '', $text{'field_none'} ],
[ 'unsigned', $text{'field_unsigned'} ],
[ 'zerofill', $text{'field_zerofill'} ] ]));
@@ -95,15 +97,19 @@ if ($type =~ /int$/) {
}
elsif ($type eq 'float' || $type eq 'double' || $type eq 'decimal') {
# Display zerofill option
$opts = $extra =~ /zerofill/ ? 'zerofill' : '';
print &ui_hidden("oldopts", $opts);
print &ui_table_row($text{'field_opts'},
&ui_radio("opts", $extra =~ /zerofill/ ? 'zerofill' : '',
&ui_radio("opts", $opts,
[ [ '', $text{'field_none'} ],
[ 'zerofill', $text{'field_zerofill'} ] ]));
}
elsif ($type eq 'char' || $type eq 'varchar') {
# Display binary option
$opts = $extra =~ /binary/ ? 'binary' : '';
print &ui_hidden("oldopts", $opts);
print &ui_table_row($text{'field_opts'},
&ui_radio("opts", $extra =~ /binary/ ? 'binary' : '',
&ui_radio("opts", $opts,
[ [ '', $text{'field_ascii'} ],
[ 'binary', $text{'field_binary'} ] ]));
}
+4 -2
View File
@@ -54,9 +54,11 @@ else {
$in{'ext'};
&execute_sql_logged($in{'db'}, $sql);
if ($in{'old'} ne $in{'field'} ||
$in{'type'} ne $in{'newtype'}) {
$in{'type'} ne $in{'newtype'} ||
$in{'oldopts'} ne $in{'opts'}) {
# Rename or retype field as well
if ($in{'type'} ne $in{'newtype'}) {
if ($in{'type'} ne $in{'newtype'} ||
$in{'oldopts'} ne $in{'opts'}) {
# Type has changed .. fix size
if ($in{'newtype'} eq 'enum' ||
$in{'newtype'} eq 'set') {