createColumsSql

  1. drupal
    1. drupal7
Versionen
drupal7 protected DatabaseSchema_sqlite::createColumsSql($tablename, $schema)

Build the SQL expression for creating columns.

Verwandte Themen

Code

includes/database/sqlite/schema.inc, line 64

<?php
protected function createColumsSql($tablename, $schema) {
  $sql_array = array();

  // Add the SQL statement for each field.
  foreach ($schema['fields'] as $name => $field) {
    if ($field['type'] == 'serial') {
      if (isset($schema['primary key']) && ($key = array_search($name, $schema['primary key'])) !== FALSE) {
        unset($schema['primary key'][$key]);
      }
    }
    $sql_array[] = $this->createFieldSql($name, $this->processField($field));
  }

  // Process keys.
  if (!empty($schema['primary key'])) {
    $sql_array[] = " PRIMARY KEY (" . $this->createKeySql($schema['primary key']) . ")";
  }

  return implode(", \n", $sql_array);
}
?>

Kommentare

Kommentar hinzufügen

Der Inhalt dieses Feldes wird nicht öffentlich zugänglich angezeigt.
  • Internet- und E-Mail-Adressen werden automatisch umgewandelt.
  • Zulässige HTML-Tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd>
  • Zeilen und Absätze werden automatisch erzeugt.

Weitere Informationen über Formatierungsoptionen

Kommentar hinzufügen

Der Inhalt dieses Feldes wird nicht öffentlich zugänglich angezeigt.
  • Internet- und E-Mail-Adressen werden automatisch umgewandelt.
  • Zulässige HTML-Tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd>
  • Zeilen und Absätze werden automatisch erzeugt.

Weitere Informationen über Formatierungsoptionen