diff --git a/classes/db/DBMysql.class.php b/classes/db/DBMysql.class.php index 2a12f94c9..533cba998 100644 --- a/classes/db/DBMysql.class.php +++ b/classes/db/DBMysql.class.php @@ -804,9 +804,17 @@ class DBMySQL extends DB } } + // Normalize data type + $type = strtolower($type); + $type = isset($this->column_type[$type]) ? $this->column_type[$type] : $type; + if(in_array($type, ['integer', 'int', 'bigint', 'smallint'])) + { + $size = ''; + } + $column_schema[$name] = sprintf('`%s` %s%s %s %s %s %s', $name, - $this->column_type[$type], + $type, $size ? "($size)" : '', $column_charset, isset($default) ? "DEFAULT '$default'" : '', @@ -828,8 +836,6 @@ class DBMySQL extends DB } } - // Process - // Process indexes if(count($primary_list)) {