the number of bits to use, and not the number of decimals. So,
based on the number of decimals from the XMLDB schema, we are
going to create REAL (<6 decimals) or DOUBLE PRECISION (>=6) columns.
}
break;
case XMLDB_TYPE_FLOAT:
- $dbtype = 'REAL';
- if (!empty($xmldb_length)) {
- $dbtype .= '(' . $xmldb_length;
- if (!empty($xmldb_decimals)) {
- $dbtype .= ',' . $xmldb_decimals;
+ $dbtype = 'DOUBLE PRECISION';
+ if (!empty($xmldb_decimals)) {
+ if ($xmldb_decimals < 6) {
+ $dbtype = 'REAL';
}
- $dbtype .= ')';
}
break;
case XMLDB_TYPE_CHAR: