You are here

protected function DatabaseSchema_sqlite::mapKeyDefinition in Drupal 7

Utility method: rename columns in an index definition according to a new mapping.

Parameters

$key_definition: The key definition.

$mapping: The new mapping.

1 call to DatabaseSchema_sqlite::mapKeyDefinition()
DatabaseSchema_sqlite::changeField in includes/database/sqlite/schema.inc
Change a field definition.

File

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

Class

DatabaseSchema_sqlite

Code

protected function mapKeyDefinition(array $key_definition, array $mapping) {
  foreach ($key_definition as &$field) {

    // The key definition can be an array($field, $length).
    if (is_array($field)) {
      $field =& $field[0];
    }
    if (isset($mapping[$field])) {
      $field = $mapping[$field];
    }
  }
  return $key_definition;
}