src/orm/classes/Driver/SQL.php
public function createTable(ORM_Table $table)
    {
        if ($table->isAlias())
        {
            return;
        }
        $db = Eresus_DB::getHandler();
        $tableName = $db->options->tableNamePrefix . $table->getName();

        $fieldDefinitions = array();
        foreach ($table->getColumns() as $field)
        {
            if (!$field->isVirtual())
            {
                $fieldDefinitions []= $this->getFieldDefinition($field);
            }
        }
        $primaryKey = $this->getPrimaryKeyDefinition($table->getPrimaryKey());
        $indexDefinitions = array();
        foreach ($table->getIndexes() as $name => $params)
        {
            $indexDefinitions []= $this->getIndexDefinition($name, $params);
        }
        $sql = $this->getCreateTableDefinition($tableName, $fieldDefinitions, $primaryKey,
            $indexDefinitions);
        try
        {
            $db->exec($sql);
        }
        catch (PDOException $e)
        {
            throw Eresus_DB_Exception_QueryFailed::create($sql, $e);
        }

        $columns = $table->getColumns();
        foreach ($columns as $name => $column)
        {
            $column->afterTableCreate($table, $name);
        }
    }
public function createTable(ORM_Table $table)
    {
        if ($table->isAlias())
        {
            return;
        }
        $db = Eresus_DB::getHandler();
        $tableName = $db->options->tableNamePrefix . $table->getName();

        $fieldDefinitions = array();
        foreach ($table->getColumns() as $field)
        {
            if (!$field->isVirtual())
            {
                $fieldDefinitions []= $this->getFieldDefinition($field);
            }
        }
        $primaryKey = $this->getPrimaryKeyDefinition($table->getPrimaryKey());
        $indexDefinitions = array();
        foreach ($table->getIndexes() as $name => $params)
        {
            $indexDefinitions []= $this->getIndexDefinition($name, $params);
        }
        $sql = $this->getCreateTableDefinition($tableName, $fieldDefinitions, $primaryKey,
            $indexDefinitions);
        try
        {
            $db->exec($sql);
        }
        catch (PDOException $e)
        {
            throw Eresus_DB_Exception_QueryFailed::create($sql, $e);
        }

        $columns = $table->getColumns();
        foreach ($columns as $name => $column)
        {
            $column->afterTableCreate($table, $name);
        }
    }
Создаёт таблицу

@param ORM_Table $table

@return void

@throws Eresus_DB_Exception_QueryFailed

@since 3.00