You are here

protected function DatabaseSchema_sqlite::processField in Drupal 7

Set database-engine specific properties for a field.

Parameters

$field: A field description array, as specified in the schema documentation.

2 calls to DatabaseSchema_sqlite::processField()
DatabaseSchema_sqlite::addField in includes/database/sqlite/schema.inc
Add a new field to a table.
DatabaseSchema_sqlite::createColumsSql in includes/database/sqlite/schema.inc
Build the SQL expression for creating columns.

File

includes/database/sqlite/schema.inc, line 114
Database schema code for SQLite databases.

Class

DatabaseSchema_sqlite

Code

protected function processField($field) {
  if (!isset($field['size'])) {
    $field['size'] = 'normal';
  }

  // Set the correct database-engine specific datatype.
  // In case one is already provided, force it to uppercase.
  if (isset($field['sqlite_type'])) {
    $field['sqlite_type'] = drupal_strtoupper($field['sqlite_type']);
  }
  else {
    $map = $this
      ->getFieldTypeMap();
    $field['sqlite_type'] = $map[$field['type'] . ':' . $field['size']];
  }
  if (isset($field['type']) && $field['type'] == 'serial') {
    $field['auto_increment'] = TRUE;
  }
  return $field;
}