_db_process_field

Versions
6
_db_process_field($field)

Set database-engine specific properties for a field.

Parameters

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

Related topics

▾ 2 functions call _db_process_field()

db_add_field in includes/database.pgsql.inc
Add a new field to a table.
db_create_table_sql in includes/database.pgsql.inc
Generate SQL to create a new table from a Drupal schema definition.

Code

includes/database.pgsql.inc, line 572

<?php
function _db_process_field($field) {
  if (!isset($field['size'])) {
    $field['size'] = 'normal';
  }
  // Set the correct database-engine specific datatype.
  if (!isset($field['pgsql_type'])) {
    $map = db_type_map();
    $field['pgsql_type'] = $map[$field['type'] .':'. $field['size']];
  }
  if ($field['type'] == 'serial') {
    unset($field['not null']);
  }
  return $field;
}
?>
Login or register to post comments
 
 

All source code and documentation on this site is released under the terms of the GNU General Public License, version 2 and later. Drupal is a registered trademark of Dries Buytaert.