You are here

function schema_engine_type in Schema 8

Same name and namespace in other branches
  1. 5 schema.module \schema_engine_type()
  2. 6 schema.module \schema_engine_type()
  3. 7 schema.module \schema_engine_type()

Converts a column's Schema type into an engine-specific data type.

1 call to schema_engine_type()
SchemaComparator::preprocessTableSchema in src/Comparison/SchemaComparator.php
Make sure the given schema is consistent.

File

./schema.module, line 277
The Schema module provides functionality built on the Schema API.

Code

function schema_engine_type($col, $table, $field, $engine = NULL) {
  $map = schema_dbobject()
    ->getFieldTypeMap();
  $size = isset($col['size']) ? $col['size'] : 'normal';
  $type = $col['type'] . ':' . $size;
  if (isset($map[$type])) {
    return $map[$type];
  }
  else {
    trigger_error(t('@table.@field: no @engine type for schema type @type.', array(
      '@engine' => $engine,
      '@type' => $type,
      '@table' => $table,
      '@field' => $field,
    )), E_USER_WARNING);
    return $col['type'];
  }
}