createColumnsSql example



  /** * {@inheritdoc} */
  public function createTableSql($name$table) {
    if (!empty($table['primary key']) && is_array($table['primary key'])) {
      $this->ensureNotNullPrimaryKey($table['primary key']$table['fields']);
    }

    $sql = [];
    $sql[] = "CREATE TABLE {" . $name . "} (\n" . $this->createColumnsSql($name$table) . "\n)\n";
    return array_merge($sql$this->createIndexSql($name$table));
  }

  /** * Build the SQL expression for indexes. */
  protected function createIndexSql($tablename$schema) {
    $sql = [];
    $info = $this->getPrefixInfo($tablename);
    if (!empty($schema['unique keys'])) {
      foreach ($schema['unique keys'] as $key => $fields) {
        
Home | Imprint | This part of the site doesn't use cookies.