function DatabaseSchema_sqlsrv::getFieldTypeMap in Drupal driver for SQL Server and SQL Azure 7.2
Same name and namespace in other branches
- 7.3 sqlsrv/schema.inc \DatabaseSchema_sqlsrv::getFieldTypeMap()
- 7 sqlsrv/schema.inc \DatabaseSchema_sqlsrv::getFieldTypeMap()
This maps a generic data type in combination with its data size to the engine-specific data type.
Overrides DatabaseSchema::getFieldTypeMap
1 call to DatabaseSchema_sqlsrv::getFieldTypeMap()
- DatabaseSchema_sqlsrv::processField in sqlsrv/
schema.inc - Set database-engine specific properties for a field.
File
- sqlsrv/
schema.inc, line 882 - Database schema code for Microsoft SQL Server database servers.
Class
Code
function getFieldTypeMap() {
// Put :normal last so it gets preserved by array_flip. This makes
// it much easier for modules (such as schema.module) to map
// database types back into schema types.
return array(
'varchar:normal' => 'nvarchar',
'char:normal' => 'nchar',
'text:tiny' => 'nvarchar(max)',
'text:small' => 'nvarchar(max)',
'text:medium' => 'nvarchar(max)',
'text:big' => 'nvarchar(max)',
'text:normal' => 'nvarchar(max)',
'serial:tiny' => 'smallint',
'serial:small' => 'smallint',
'serial:medium' => 'int',
'serial:big' => 'bigint',
'serial:normal' => 'int',
'int:tiny' => 'smallint',
'int:small' => 'smallint',
'int:medium' => 'int',
'int:big' => 'bigint',
'int:normal' => 'int',
'float:tiny' => 'real',
'float:small' => 'real',
'float:medium' => 'real',
'float:big' => 'float(53)',
'float:normal' => 'real',
'numeric:normal' => 'numeric',
'blob:big' => 'varbinary(max)',
'blob:normal' => 'varbinary(max)',
'datetime:normal' => 'timestamp',
'date:normal' => 'date',
'datetime:normal' => 'datetime2(0)',
'time:normal' => 'time(0)',
);
}