Permalink
Browse files

All this time, table_column() didn't handle CHAR fields correctly! :o

  • Loading branch information...
defacer
defacer committed Jul 20, 2005
1 parent 7c109f7 commit b586f7cda259060fa127f654bfb2034daf1bd8c2
Showing with 8 additions and 0 deletions.
  1. +8 −0 lib/datalib.php
View
@@ -231,6 +231,10 @@ function table_column($table, $oldfield, $field, $type='integer', $size='10',
case 'integer':
$type = 'INTEGER('. $size .')';
break;
+ case 'char':
+ $type = 'CHAR('. $size .')';
+ $signed = '';
+ break;
case 'varchar':
$type = 'VARCHAR('. $size .')';
$signed = '';
@@ -345,6 +349,10 @@ function table_column($table, $oldfield, $field, $type='integer', $size='10',
case 'varchar':
$type = 'VARCHAR';
break;
+ case 'char':
+ $type = 'CHAR('. $size .')';
+ $signed = '';
+ break;
}
$default = 'DEFAULT \''. $default .'\'';

0 comments on commit b586f7c

Please sign in to comment.