You are here

protected function DatabaseSchema_mysql::createKeySql in Drupal 7

3 calls to DatabaseSchema_mysql::createKeySql()
DatabaseSchema_mysql::addIndex in includes/database/mysql/schema.inc
Add an index.
DatabaseSchema_mysql::addPrimaryKey in includes/database/mysql/schema.inc
Add a primary key.
DatabaseSchema_mysql::addUniqueKey in includes/database/mysql/schema.inc
Add a unique key.

File

includes/database/mysql/schema.inc, line 289
Database schema code for MySQL database servers.

Class

DatabaseSchema_mysql

Code

protected function createKeySql($fields) {
  $return = array();
  foreach ($fields as $field) {
    if (is_array($field)) {
      $return[] = '`' . $field[0] . '`(' . $field[1] . ')';
    }
    else {
      $return[] = '`' . $field . '`';
    }
  }
  return implode(', ', $return);
}